Undo a commit?

rupert.thurner rupert.thurner at gmail.com
Tue Jul 14 16:15:11 CDT 2009


On Jul 14, 5:16 pm, "Afriza N. Arief" <afriza... at gmail.com> wrote:
> On Tue, Jul 14, 2009 at 8:03 PM, Masklinn <maskl... 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

is strip the same as rollback? and if yes why it has a different name?

rupert.



More information about the Mercurial mailing list