Created
February 28, 2014 14:18
-
-
Save fullstackto/9271830 to your computer and use it in GitHub Desktop.
How to grab a file from a previous git commit
This file contains hidden or 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
git checkout HEAD~n path/to/file.ext | |
git commit -am "Retrieving file_name.ext from previous commit" | |
git push origin | |
Where n in HEAD~n is the number of previous commits to go back for the file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment