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.