tags:

views:

37

answers:

1

Apparently some old bug fix commit of mine got dropped during a recent merge of old branch into new. I found the commit in the logs and have the ID (403357cab89465ce68001762d35fe27b57aeec65). Now I just want to restore that commit to the current working branch so I can firstly diff those changes but likely commit them all in again. How can I do this?

git checkout 403357cab89465ce68001762d35fe27b57aeec65

doesn't work.

And by the way, the commit involved edits to multiple files.

+4  A: 

Do a git cherry-pick sha1 and it will pull that commit on top of your current HEAD.

Daenyth
oh wow, that basically took the commit and plugged it right back in! thanks, but was hoping to see the changes staged first so i could diff them, verify i need them, etc. before deciding to commmit.
Doug
You can do `git reset HEAD^` now to leave the changes in your working copy but remove the commit (assuming you have not pushed). Also, you can mark an answer as accepted in the system here by clicking the check mark :)
Daenyth