2327
2327
class cmd_revert(Command):
2328
"""Reverse all changes since the last commit.
2330
Only versioned files are affected. Specify filenames to revert only
2331
those files. By default, any files that are changed will be backed up
2332
first. Backup files have a '~' appended to their name.
2328
"""Revert files to a previous revision.
2330
Giving a list of files will revert only those files. Otherwise, all files
2331
will be reverted. If the revision is not specified with '--revision', the
2332
last committed revision is used.
2334
To remove only some changes, without reverting to a prior version, use
2335
merge instead. For example, "merge . --r-2..-3" will remove the changes
2336
introduced by -2, without affecting the changes introduced by -1. Or
2337
to remove certain changes on a hunk-by-hunk basis, see the Shelf plugin.
2339
By default, any files that have been manually changed will be backed up
2340
first. (Files changed only by merge are not backed up.) Backup files have
2341
'.~#~' appended to their name, where # is a number.
2343
When you provide files, you can use their current pathname or the pathname
2344
from the target revision. So you can use revert to "undelete" a file by
2345
name. If you name a directory, all the contents of that directory will be
2334
2348
takes_options = ['revision', 'no-backup']
2335
2349
takes_args = ['file*']