0

I have a project that i don't spend much time on other than to quickly commit after a change and push to the main server every now and then. Today i noticed that there was an issue with detached heads and went to fix it (without really knowing what i am doing). I wasn't sure what branch i was on as none were highlighted in source tree so i clicked on the develop branch and it took me back to a branch from 2014. I tried all the branches and they were all from awhile ago. I looked on the server and its the same story.

Now my issue: i cant find where i was committing to! git branch command only shows me the old ones. Where have my latest commits being going and how can i restore them. Although i only added small tweaks and bug fixes, it would be weeks of work lost if i could not restore.

Roman
  • 19,581
  • 6
  • 68
  • 84
DBHC
  • 95
  • 12
  • 2
    Use the [reflog](http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html) to find it. You can [specify](http://stackoverflow.com/questions/17369254/is-there-a-way-to-cause-git-reflog-to-show-a-date-alongside-each-entry) the output of the command to make it easier to find where your commits were. – Roman Mar 11 '15 at 13:33
  • Sorry this was a duplicate. My initial searches were failing as i wasn't sure exactly what was wrong and with so much at stake i panicked! – DBHC Mar 11 '15 at 13:48

0 Answers0