@@ -8,43 +8,17 @@ git-reset - Reset current HEAD to the specified state
88SYNOPSIS
99--------
1010[synopsis]
11+ git reset [-- soft | -- mixed [-N] | -- hard | -- merge | -- keep] [-q] [<commit >]
1112git reset [-q] [<tree-ish >] [-- ] <pathspec >...
1213git reset [-q] [-- pathspec-from-file=<file > [-- pathspec-file-nul]] [<tree-ish >]
1314git reset (-- patch | -p) [<tree-ish >] [-- ] [<pathspec >... ]
14- git reset [-- soft | -- mixed [-N] | -- hard | -- merge | -- keep] [-q] [<commit >]
1515
1616DESCRIPTION
1717-----------
18- In the first three forms, copy entries from _<tree-ish>_ to the index.
19- In the last form, set the current branch head (`HEAD` ) to _<commit>_ ,
18+ In the first form, set the current branch head (`HEAD` ) to _<commit>_ ,
2019optionally modifying index and working tree to match.
2120The _<tree-ish>_ /_<commit>_ defaults to `HEAD` in all forms.
22-
23- `git reset [-q] [<tree-ish>] [--] <pathspec>...` ::
24- `git reset [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]` ::
25- These forms reset the index entries for all paths that match the
26- _<pathspec>_ to their state at _<tree-ish>_ . (It does not affect
27- the working tree or the current branch.)
28- +
29- This means that `git reset <pathspec>` is the opposite of `git add
30- <pathspec >`. This command is equivalent to
31- `git restore [--source=<tree-ish>] --staged <pathspec>...` .
32- +
33- After running `git reset <pathspec>` to update the index entry, you can
34- use linkgit:git-restore[1] to check the contents out of the index to
35- the working tree. Alternatively, using linkgit:git-restore[1]
36- and specifying a commit with `--source` , you
37- can copy the contents of a path out of a commit to the index and to the
38- working tree in one go.
39-
40- `git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>...]` ::
41- Interactively select hunks in the difference between the index
42- and _<tree-ish>_ (defaults to `HEAD` ). The chosen hunks are applied
43- in reverse to the index.
44- +
45- This means that `git reset -p` is the opposite of `git add -p` , i.e.
46- you can use it to selectively reset hunks. See the "Interactive Mode"
47- section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
21+ In the last three forms, copy entries from _<tree-ish>_ to the index.
4822
4923`git reset [<mode>] [<commit>]` ::
5024 This form resets the current branch head to _<commit>_ and
@@ -98,6 +72,32 @@ but carries forward unmerged index entries.
9872 the submodules' `HEAD` to be detached at that commit.
9973--
10074
75+ `git reset [-q] [<tree-ish>] [--] <pathspec>...` ::
76+ `git reset [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]` ::
77+ These forms reset the index entries for all paths that match the
78+ _<pathspec>_ to their state at _<tree-ish>_ . (It does not affect
79+ the working tree or the current branch.)
80+ +
81+ This means that `git reset <pathspec>` is the opposite of `git add
82+ <pathspec >`. This command is equivalent to
83+ `git restore [--source=<tree-ish>] --staged <pathspec>...` .
84+ +
85+ After running `git reset <pathspec>` to update the index entry, you can
86+ use linkgit:git-restore[1] to check the contents out of the index to
87+ the working tree. Alternatively, using linkgit:git-restore[1]
88+ and specifying a commit with `--source` , you
89+ can copy the contents of a path out of a commit to the index and to the
90+ working tree in one go.
91+
92+ `git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>...]` ::
93+ Interactively select hunks in the difference between the index
94+ and _<tree-ish>_ (defaults to `HEAD` ). The chosen hunks are applied
95+ in reverse to the index.
96+ +
97+ This means that `git reset -p` is the opposite of `git add -p` , i.e.
98+ you can use it to selectively reset hunks. See the "Interactive Mode"
99+ section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
100+
101101See "Reset, restore and revert" in linkgit:git[1] for the differences
102102between the three commands.
103103
0 commit comments