Skip to content

Instantly share code, notes, and snippets.

@JrGoodle
Last active August 29, 2015 14:22
Show Gist options
  • Save JrGoodle/a38ce8a6515dbc705f7a to your computer and use it in GitHub Desktop.
Save JrGoodle/a38ce8a6515dbc705f7a to your computer and use it in GitHub Desktop.
Git - Check out deleted file from commit before deletion
RESTORE_FILE=file/to/restore
git checkout $(git rev-list -n 1 HEAD -- "$RESTORE_FILE")^ -- "$RESTORE_FILE"
@JrGoodle
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment