Search code examples
version-controlmercurialrevert

revision control: undo changes that were NOT checked in


I was playing around with some files (someone else's code mounted on the machine, I have to model my code after it) and short story: something went wrong. The page is printing the header twice, the error messages are going haywire, etc... I'm not sure what I did. I tried to undo all my changes, but it's not working. I must be missing something.

I didn't actually check in my code, but the changes were still kept. Is there anyway that I can just get back to the way the files were before I started playing around with them (i.e this morning)? I know about hg revert, but I'm not sure if it's a good idea; Mercurial seems pretty certain that I don't want to use revert... Like, ever.

Really frustrated with this, so I really appreciate any suggestions.


Solution

  • The short answer is that yeah, just go ahead and use revert, that's what you want to do in this case. This question is not a duplicate of yours per se, but it explains some of the subtleties of using revert and similar Mercurial commands.