Undo a commit?

Masklinn masklinn at masklinn.net
Tue Jul 14 07:03:32 CDT 2009


On 14 Jul 2009, at 11:34 , Andreas Tscharner wrote:
> On 14.07.2009 09:35, Joseph Turian wrote:
>> How do I undo a commit?
>
> You can do an actual UNDO with a
> *hg rollback*
> But as previous said, this only works for the last commit. When  
> undoing
> with a rollback, this commit will not show up in the changelog
>
> You can undo the changes of a former commit using
> *hg backout*
> Backout undoes the given earlier commit and creates a new head. You  
> have to
> hg merge
> and
> hg commit after that. And this actions will be logged, e.g. they will
> show up in the changelog.
>
You can also rework your history by using mq, as long as it hasn't  
gone out of your machine (and ideally is linear, I don't know how mq  
deals with merged branches but I doubt I want to): qimport everything  
from (and including) the changeset to remove, qpop everything, remove  
the offending changeset from your series, qpush everything, then  
qfinish (if the patches applications worked).


More information about the Mercurial mailing list