To get your lost commits in git
To find lost commits in git just do following -:
git fsck --full --no-reflogs --unreachable --lost-found | grep commit | cut -d\ -f3 | xargs -n 1 git log -n 1 --pretty=oneline > .git/lost-found.txt
Now read all commits in .git/lost-found.txt
To bring back
git checkout <SHA>
Written by Rashmi
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rashmi14yadav
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#