I committed some changes (call it revision B). Then I did hg up A
back to an earlier version to fix some bug. Forgetting I had done this update, I realized that I had committed my last changes to the wrong branch. So I hg rollback
to get rid of that commit (B). It did that part well, but now I am sitting at revision A with the old code, my last commit gone, and hg st
says everything is up to date at A.
I guess I lost everything that went into commit B? Is there any way to get it back?
Edit: I did not push this anywhere, it all happened locally
Your changes are lost - rollback
completely eliminates the commit (ref)(other ref). It's preferable to dorevert
when attempting to access previous changesets, since that doesn't delete any subsquent changesets - it simply changes the current state of your files to look like they did at the changeset you're reverting to. So if you commit revision B and then revert to revision A, your files will look like they did at revision A, but any changes you make will be put into your next revision C, and revision B will remain in your repo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With