Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git - Recover lost commit
# Get a list of where HEAD has been recently
git reflog
# Check the sha1 where you think the correct code might be
git show <sha1>
# When you've found it, merge it back in
git merge <sha1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment