doc: git-reset: clarify `git reset <pathspec>`

From user feedback: - Continued confusion about the terms "tree-ish" and "pathspec" - The word "hunks" is confusing folks, use "changes" instead. - On the part about `git restore`, there were a few comments to the effect of "wait, this doesn't actually update any files? What? Why?" Be more direct that `git reset` does not update files: there's no obvious reason to suggest that folks use `git reset` followed by `git restore`, instead suggest just using `git restore`. Continue avoiding the use of the word "reset" to describe what "git reset" does. Signed-off-by: Julia Evans <julia@jvns.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Julia Evans committed Jan 5, 2026 at 16:48 UTC 555c8464e5949fcd35ec9878f83874a998beb787
1 file changed +12 -16
Documentation/git-reset.adoc
+12 -16
@@ -81,29 +81,25 @@ linkgit:git-add[1]).
81
82 `git reset [-q] [<tree-ish>] [--] <pathspec>...`::
83 `git reset [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]`::
84 - These forms reset the index entries for all paths that match the
85 - _<pathspec>_ to their state at _<tree-ish>_. (It does not affect
86 - the working tree or the current branch.)
84 + For all specified files or directories, set the staged version to
85 + the version from the given commit or tree (which defaults to `HEAD`).
86 +
87 This means that `git reset <pathspec>` is the opposite of `git add
89 -<pathspec>`. This command is equivalent to
90 -`git restore [--source=<tree-ish>] --staged <pathspec>...`.
88 +<pathspec>`: it unstages all changes to the specified file(s) or
89 +directories. This is equivalent to `git restore --staged <pathspec>...`.
90 +
92 -After running `git reset <pathspec>` to update the index entry, you can
93 -use linkgit:git-restore[1] to check the contents out of the index to
94 -the working tree. Alternatively, using linkgit:git-restore[1]
95 -and specifying a commit with `--source`, you
96 -can copy the contents of a path out of a commit to the index and to the
97 -working tree in one go.
91 +In this mode, `git reset` updates only the index (without updating the `HEAD` or
92 +working tree files). If you want to update the files as well as the index
93 +entries, use linkgit:git-restore[1].
94
95 `git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>...]`::
100 - Interactively select hunks in the difference between the index
101 - and _<tree-ish>_ (defaults to `HEAD`). The chosen hunks are applied
102 - in reverse to the index.
96 + Interactively select changes from the difference between the index
97 + and the specified commit or tree (which defaults to `HEAD`).
98 + The index is modified using the chosen changes.
99 +
100 This means that `git reset -p` is the opposite of `git add -p`, i.e.
105 -you can use it to selectively reset hunks. See the "Interactive Mode"
106 -section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
101 +you can use it to selectively unstage changes. See the "Interactive Mode"
102 +section of linkgit:git-add[1] to learn how to use the `--patch` option.
103
104 See "Reset, restore and revert" in linkgit:git[1] for the differences
105 between the three commands.