4090 |
4090 |
4091 .. note:: |
4091 .. note:: |
4092 To check out earlier revisions, you should use :hg:`update REV`. |
4092 To check out earlier revisions, you should use :hg:`update REV`. |
4093 To cancel a merge (and lose your changes), use :hg:`update --clean .`. |
4093 To cancel a merge (and lose your changes), use :hg:`update --clean .`. |
4094 |
4094 |
4095 With no revision specified, revert the named files or directories |
4095 With no revision specified, revert the specified files or directories |
4096 to the state they had in the first parent of the working directory. |
4096 to the state they had in the first parent of the working directory. |
4097 This restores the contents of the affected files to an unmodified |
4097 This restores the contents of files to an unmodified |
4098 state and unschedules adds, removes, copies, and renames. |
4098 state and unschedules adds, removes, copies, and renames. |
4099 |
4099 |
4100 Using the -r/--rev option, revert the given files or directories |
4100 Using the -r/--rev or -d/--date options, revert the given files or |
4101 to their contents as of a specific revision. This can be helpful |
4101 directories to their contents as of a specific revision. This can |
4102 to "roll back" some or all of an earlier change. See :hg:`help |
4102 be helpful to "roll back" some or all of an earlier change. |
4103 dates` for a list of formats valid for -d/--date. |
|
4104 |
4103 |
4105 Revert modifies the working directory. It does not commit any |
4104 Revert modifies the working directory. It does not commit any |
4106 changes, or change the parent of the working directory. If you |
4105 changes, or change the parent of the working directory. If you |
4107 revert to a revision other than the parent of the working |
4106 revert to a revision other than the parent of the working |
4108 directory, the reverted files will thus appear modified |
4107 directory, the reverted files will thus appear modified |
4111 If names are given, all files matching the names are reverted. |
4110 If names are given, all files matching the names are reverted. |
4112 If no arguments are given, no files are reverted. |
4111 If no arguments are given, no files are reverted. |
4113 |
4112 |
4114 Modified files are saved with a .orig suffix before reverting. |
4113 Modified files are saved with a .orig suffix before reverting. |
4115 To disable these backups, use --no-backup. |
4114 To disable these backups, use --no-backup. |
|
4115 |
|
4116 See :hg:`help dates` for a list of formats valid for -d/--date. |
4116 |
4117 |
4117 Returns 0 on success. |
4118 Returns 0 on success. |
4118 """ |
4119 """ |
4119 |
4120 |
4120 if opts.get("date"): |
4121 if opts.get("date"): |