sapling/website/docs/commands/uncommit.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.6 KiB

sidebar_position
43

uncommit | unc

uncommit part or all of the current commit

Reverse the effects of an sl commit operation. When run with no arguments, hides the current commit and checks out the parent commit, but does not revert the state of the working copy. Changes that were contained in the uncommitted commit become pending changes in the working copy.

sl uncommit cannot be run on commits that have children. In other words, you cannot uncommit a commit in the middle of a stack. Similarly, by default, you cannot run sl uncommit if there are pending changes in the working copy.

You can selectively uncommit files from the current commit by optionally specifying a list of files to remove. The specified files are removed from the list of changed files in the current commit, but are not modified on disk, so they appear as pending changes in the working copy.

Running sl uncommit is similar to running sl undo --keep immediately after sl commit. However, unlike sl undo, which can only undo a commit if it was the last operation you performed, sl uncommit can uncommit any draft commit in the graph that does not have children.

arguments

shortname fullname default description
--keep false allow an empty commit after uncommiting
-I --include include files matching the given patterns
-X --exclude exclude files matching the given patterns