hg rewind [--as-divergence] [--exact] [--keep] [--to REV]... [--from REV]...

aliases: undo

rewind a stack of changesets to a previous state

This command can be used to restore stacks of changesets to an obsolete state, creating identical copies.

There are two main ways to select the rewind target. Rewinding "from" changesets will restore the direct predecessors of these changesets (and obsolete the changeset you rewind from). Rewinding "to" will restore the changeset you have selected (and obsolete their latest successors).

By default, we rewind from the working directory parents, restoring its predecessor.

When we rewind to an obsolete version, we also rewind to all its obsolete ancestors. To only rewind to the explicitly selected changesets use the '--exact' flag. Using the '--exact' flag can restore some changesets as orphan.

The latest successors of the obsolete changesets will be superseded by these new copies. This behavior can be disabled using '--as-divergence', the current latest successors won't be affected and content-divergence will appear between them and the restored version of the obsolete changesets.

Current rough edges:

options ([+] can be repeated):

--to REV [+] rewind to these revisions
--as-divergence preserve current latest successors
--exact only rewind explicitly selected revisions
--from REV [+] rewind these revisions to their predecessors
-k --keep do not modify working directory during rewind

global options ([+] can be repeated):

-R --repository REPO repository root directory or name of overlay bundle file
--cwd DIR change working directory
-y --noninteractive do not prompt, automatically pick the first choice for all prompts
-q --quiet suppress output
-v --verbose enable additional output
--color TYPE when to colorize (boolean, always, auto, never, or debug)
--config CONFIG [+] set/override config option (use 'section.name=value')
--debug enable debugging output
--debugger start debugger
--encoding ENCODE set the charset encoding (default: ascii)
--encodingmode MODE set the charset encoding mode (default: strict)
--traceback always print a traceback on exception
--time time how long the command takes
--profile print command execution profile
--version output version information and exit
-h --help display help and exit
--hidden consider hidden changesets
--pager TYPE when to paginate (boolean, always, auto, or never) (default: auto)