Skip to content

Instantly share code, notes, and snippets.

@gtrias
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtrias/92387a2277440f4575d7 to your computer and use it in GitHub Desktop.
Save gtrias/92387a2277440f4575d7 to your computer and use it in GitHub Desktop.
Git search for files
# Source: http://stackoverflow.com/questions/7203515/how-to-locate-a-deleted-file-in-the-commit-history
# Search for a file knowing the path
git log --all -- <path-to-file>
# Display the file on that sha
git show <SHA> -- <path-to-file>
# Restore file for that sha
git checkout <SHA> -- <path-to-file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment