Late yesterday I finished up a day's worth of work and went to github and commited, then hit the sync button. I briefly saw a message on the screen saying something about needing to fix merge conflicts, but the message was self-dismissed before I could read it completely.
My outstanding commit disappeared, so I figured all was well. This morning I started work again and ALL the new code that I did had been reverted to the prior commit from two days before. There is no mention of any of the changes I had made nor of the commit I did just before finishing up my work day... they are just gone.
Any suggestions on recovery?
UPDATE
For what it's worth, I was browsing the log files in my git folder and I see my commit:
37c661799950211c713630301cf8cbe609de6c59 f94366329fa93cec529b83b34a607449725f5270 [user info removed] 1360710557 -0700 commit: Shout page
f94366329fa93cec529b83b34a607449725f5270 b588ed19e77ef55611a4a82896c5ef2c26f3e4cd [user info removed] 1360710567 -0700 checkout: moving from master to b588ed19e77ef55611a4a82896c5ef2c26f3e4cd^0
b588ed19e77ef55611a4a82896c5ef2c26f3e4cd b588ed19e77ef55611a4a82896c5ef2c26f3e4cd [user info removed] 1360710576 -0700 rebase finished: returning to refs/heads/master
Try to use git reflog
to find the hash of the lost commit. You can then either use git cherry-pick
, git merge
or git reset --hard
(depending on what it is you want to do with the lost history) to recover. If you need to see diffs in order to identify your commit, use git reflog -p
.