sapling/website/docs/commands/revert.md
Shish 2582363c7c Regenerate command auto-docs (#266)
Summary:
Stack created with [Sapling]
* https://github.com/facebook/sapling/issues/270
* https://github.com/facebook/sapling/issues/267
* __->__ https://github.com/facebook/sapling/issues/266
* https://github.com/facebook/sapling/issues/264

[docs] Regenerate command auto-docs

 I want to add syntax highlighting to the auto-generated docs, but they are out of date, so first let's update them

Pull Request resolved: https://github.com/facebook/sapling/pull/266

Reviewed By: bolinfest

Differential Revision: D41544316

Pulled By: shish

fbshipit-source-id: f6523275073add5a90982963089012e46f516d29
2022-12-05 12:56:27 -08:00

1.8 KiB

sidebar_position
34

revert

change the specified files to match a commit

With no revision specified, restore the contents of files to an unmodified state and unschedule adds, removes, copies, and renames. In other words, revert the specified files or directories to the contents they had in the current commit. If you are in the middle of an unfinished merge state, you must explicitly specify a revision.

Use the -r/--rev option to revert the given files or directories to their states as of a specific commit. Because revert does not actually check out the specified commit, the files appear as modified and show up as pending changes in sl status.

Revert causes files to match their contents in another commit. If instead you want to undo a specific landed commit, use sl backout instead. Run sl help backout for more information.

Modified files are saved with an .orig suffix before reverting. To disable these backups, use --no-backup. You can configure Sapling to store these backup files in a custom directory relative to the root of the repository by setting the ui.origbackuppath configuration option.

Returns 0 on success.

arguments

shortname fullname default description
-a --all revert all changes when no arguments given
-d --date tipmost revision matching date
-r --rev revert to the specified revision
-C --no-backup do not save backup copies of files
-i --interactive interactively select the changes
-I --include include files matching the given patterns
-X --exclude exclude files matching the given patterns
-n --dry-run do not perform actions, just print output