Skip to content

Instantly share code, notes, and snippets.

@olssonm
Created January 26, 2018 07:24
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 olssonm/28cfcde2b2f58337c0421f2e1c446719 to your computer and use it in GitHub Desktop.
Save olssonm/28cfcde2b2f58337c0421f2e1c446719 to your computer and use it in GitHub Desktop.
Restore files to a previous state in git
# Via https://stackoverflow.com/questions/215718/reset-or-revert-a-specific-file-to-a-specific-revision-using-git
git checkout c5f567 -- file1/to/restore file2/to/restore
# ~1 denotes commits before hash
git checkout c5f567~1 -- file1/to/restore file2/to/restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment