Created
January 26, 2018 07:24
-
-
Save olssonm/28cfcde2b2f58337c0421f2e1c446719 to your computer and use it in GitHub Desktop.
Restore files to a previous state in git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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