From: Alexandr Miloslavskiy via GitGitGadget Date: Mon, 04 Nov 2019 19:26:42 GMT Subject: [PATCH 2/5] doc: reset: unify description Message-ID: <1740ac7a291cfc81418c2d437201c3373487fa26.1572895605.git.gitgitgadget@gmail.com> In-Reply-To: From: Alexandr Miloslavskiy Synchronize it to `git add`, which has a pretty good description. Signed-off-by: Alexandr Miloslavskiy --- Documentation/git-reset.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 97e0544d9e..b0ea6e0ce5 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -8,8 +8,8 @@ git-reset - Reset current HEAD to the specified state SYNOPSIS -------- [verse] -'git reset' [-q] [] [--] ... -'git reset' (--patch | -p) [] [--] [...] +'git reset' [-q] [] [--] ... +'git reset' (--patch | -p) [] [--] [...] 'git reset' [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [] DESCRIPTION @@ -19,27 +19,33 @@ In the third form, set the current branch head (`HEAD`) to ``, optionally modifying index and working tree to match. The ``/`` defaults to `HEAD` in all forms. -'git reset' [-q] [] [--] ...:: - This form resets the index entries for all `` to their +'git reset' [-q] [] [--] ...:: + This form resets the index entries for all `` to their state at ``. (It does not affect the working tree or the current branch.) + -This means that `git reset ` is the opposite of `git add -`. This command is equivalent to -`git restore [--source=] --staged ...`. +For more details about the syntax, see the 'pathspec' entry +in linkgit:gitglossary[7]. + -After running `git reset ` to update the index entry, you can +This means that `git reset ` is the opposite of `git add +`. This command is equivalent to +`git restore [--source=] --staged ...`. ++ +After running `git reset ` to update the index entry, you can use linkgit:git-restore[1] to check the contents out of the index to the working tree. Alternatively, using linkgit:git-restore[1] and specifying a commit with `--source`, you can copy the contents of a path out of a commit to the index and to the working tree in one go. -'git reset' (--patch | -p) [] [--] [...]:: +'git reset' (--patch | -p) [] [--] [...]:: Interactively select hunks in the difference between the index and `` (defaults to `HEAD`). The chosen hunks are applied in reverse to the index. + +For more details about the syntax, see the 'pathspec' entry +in linkgit:gitglossary[7]. ++ This means that `git reset -p` is the opposite of `git add -p`, i.e. you can use it to selectively reset hunks. See the ``Interactive Mode'' section of linkgit:git-add[1] to learn how to operate the `--patch` mode. -- gitgitgadget