Undo a commit?

Afriza N. Arief afriza.na at gmail.com
Tue Jul 14 10:16:52 CDT 2009


On Tue, Jul 14, 2009 at 8:03 PM, Masklinn <masklinn at masklinn.net> wrote:

> 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).


you can also use strip command <http://mercurial.selenic.com/wiki/Strip>.. i
think you need to enable mq
extension<http://mercurial.selenic.com/wiki/MqExtension#Configuration>
first
as it is provided by mq<http://mercurial.selenic.com/wiki/MqExtension#Strip>
..

make sure you make a backup (bundle/clone/etc..) if you think you might want
to restore the undone commit.. see the reason
here<http://thread.gmane.org/gmane.comp.version-control.mercurial.general/14584>
..

regards,

Afriza N. Arief
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20090714/a891c6d9/attachment.htm 


More information about the Mercurial mailing list