Options for undoing / reverting earlier commit

Simon Harrison info at simonh.uk
Thu Oct 10 14:54:31 UTC 2024


On Thu, 10 Oct 2024 16:39:29 +0200
Georges Racinet <georges.racinet at cloudcrane.io> wrote:

> Hi,
> 
> On 10/10/24 09:58, Simon Harrison wrote:
> > Let's say I have a repo with 100 commits.
> >
> > For some reason I'm not happy with r50 and would like to remove
> > *some* of the changes that are in that revision, but keep all
> > following commits. What are my options to achieve this? I've been
> > looking at "revert" and "backout" but unless I'm mistaken, they
> > don't offer an interactive option (and may not be designed for this
> > use case).
> 
> `hg revert` does have the `-i` (interactive) option. I use it every
> day and that is what I would use in your scenario. If the changes are
> big, I tend to use it several times, focusing it with explicit paths.
> 
> Best,
> 
> 

My goodness. Completely missed that! Brain must have been not turned on
fully this morning.

Cheers


More information about the Mercurial mailing list