Recovering from lost git commit messages

I posted a question and answer to stack overflow that explains how to undo the dangerous -c flag in git. 

 

http://stackoverflow.com/questions/22768695/how-do-you-undo-a-mistakenly-overwiten-git-commit-message

If ever you accidentially overwrite a commit message using git commit –amend, you can easily undo it by search the .git/logs directory. There will still be a hash that points to the previous object which will contain the original message. 

 

 

About spuder
spuder is a "super computer" support engineer by day, and tinkerer / hobbyist by night.

Leave a comment