Created
September 8, 2016 09:39
-
-
Save BenDLH/a2a2bd167e5b259a0cfdba6f6378f750 to your computer and use it in GitHub Desktop.
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
Open a terminal window and cd into a folder under the repository. Then: | |
git fsck | awk '{print $3}' > tmp.txt | |
cat tmp.txt | xargs git show > tmp2.txt | |
Now open tmp2.txt in editor, locate your lost code, and find the commit-id on top of it. Then apply the code: | |
git stash apply <commit id> | |
rm tmp.txt tmp2.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment