Git: get back my commited data from a messed up local repo

Posted by Karussell on Super User See other posts from Super User or by Karussell
Published on 2010-12-29T18:27:34Z Indexed on 2010/12/29 18:55 UTC
Read the original article Hit count: 199

Filed under:
|

I am a newbie to git so I think I made something stupid (will move back to hg soon ;-))

Assume I'm at version A and I commited a change but didn't want that. Now assume we have version B. I didn't found a good solution how to cleanly roll B back to A but went back to A via checkout and continued commiting - assume I have version C.

A--->B
 \-->C

Now the problem is that those commits were successfull (I can see the SHA's and the msg in .git/logs/HEAD)

but the commits do not show up in the log and I couldn't push them to github. Before detecting the mess I checkout to 'master' ... and git rolled all back to B.

How can I get my version C back or are my changes lost?

Is this the same problem as described here?

Please close. I posted it here. On stackoverflow seems to be more questions related to that ...

© Super User or respective owner

Related posts about git

Related posts about github