Options for undoing / reverting earlier commit

Georges Racinet georges.racinet at cloudcrane.io
Thu Oct 10 14:39:29 UTC 2024


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,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20241010/df0119c0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xB8EB20361976F291.asc
Type: application/pgp-keys
Size: 677 bytes
Desc: OpenPGP public key
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20241010/df0119c0/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20241010/df0119c0/attachment.asc>


More information about the Mercurial mailing list