4730
4730
class cmd_revert(Command):
4731
__doc__ = """Revert files to a previous revision.
4732
Set files in the working tree back to the contents of a previous revision.
4733
4734
Giving a list of files will revert only those files. Otherwise, all files
4734
4735
will be reverted. If the revision is not specified with '--revision', the
4735
last committed revision is used.
4736
working tree basis revision is used. A revert operation affects only the
4737
working tree, not any revision history like the branch and repository or
4738
the working tree basis revision.
4737
4740
To remove only some changes, without reverting to a prior version, use
4738
4741
merge instead. For example, "merge . -r -2..-3" (don't forget the ".")
4739
4742
will remove the changes introduced by the second last commit (-2), without
4740
4743
affecting the changes introduced by the last commit (-1). To remove
4741
4744
certain changes on a hunk-by-hunk basis, see the shelve command.
4745
To update the branch to a specific revision or the latest revision and
4746
update the working tree accordingly while preserving local changes, see the
4743
By default, any files that have been manually changed will be backed up
4744
first. (Files changed only by merge are not backed up.) Backup files have
4745
'.~#~' appended to their name, where # is a number.
4749
Uncommitted changes to files that are reverted will be discarded.
4750
Howver, by default, any files that have been manually changed will be
4751
backed up first. (Files changed only by merge are not backed up.) Backup
4752
files have '.~#~' appended to their name, where # is a number.
4747
4754
When you provide files, you can use their current pathname or the pathname
4748
4755
from the target revision. So you can use revert to "undelete" a file by