@@ -7,23 +7,23 @@ git-reset - Reset current HEAD to the specified state
77
88SYNOPSIS
99--------
10- [verse ]
11- ' git reset' [-q] [<tree-ish >] [-- ] <pathspec >...
12- ' git reset' [-q] [-- pathspec-from-file=<file > [-- pathspec-file-nul]] [<tree-ish >]
13- ' git reset' (-- patch | -p) [<tree-ish >] [-- ] [<pathspec >... ]
14- ' git reset' [-- soft | -- mixed [-N] | -- hard | -- merge | -- keep] [-q] [<commit >]
10+ [synopsis ]
11+ git reset [-q] [<tree-ish >] [-- ] <pathspec >...
12+ git reset [-q] [-- pathspec-from-file=<file > [-- pathspec-file-nul]] [<tree-ish >]
13+ git 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 three forms, copy entries from _ <tree-ish>_ to the index.
19+ In the last form, set the current branch head (`HEAD` ) to _ <commit>_ ,
2020optionally modifying index and working tree to match.
21- The ` <tree-ish>` / ` <commit>` defaults to `HEAD` in all forms.
21+ The _ <tree-ish>_ / _ <commit>_ defaults to `HEAD` in all forms.
2222
23- ' git reset' [-q] [<tree-ish >] [-- ] <pathspec >... ::
24- ' git reset' [-q] [-- pathspec-from-file=<file > [-- pathspec-file-nul]] [<tree-ish >]::
23+ ` git reset [-q] [<tree-ish>] [--] <pathspec>...` ::
24+ ` git reset [-q] [--pathspec-from-file=<file> [--pathspec-file-nul]] [<tree-ish>]` ::
2525 These forms reset the index entries for all paths that match the
26- ` <pathspec>` to their state at ` <tree-ish>` . (It does not affect
26+ _ <pathspec>_ to their state at _ <tree-ish>_ . (It does not affect
2727 the working tree or the current branch.)
2828+
2929This means that `git reset <pathspec>` is the opposite of `git add
@@ -37,64 +37,64 @@ and specifying a commit with `--source`, you
3737can copy the contents of a path out of a commit to the index and to the
3838working tree in one go.
3939
40- ' git reset' (-- patch | -p) [<tree-ish >] [-- ] [<pathspec >... ]::
40+ ` git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>...]` ::
4141 Interactively select hunks in the difference between the index
42- and ` <tree-ish>` (defaults to `HEAD` ). The chosen hunks are applied
42+ and _ <tree-ish>_ (defaults to `HEAD` ). The chosen hunks are applied
4343 in reverse to the index.
4444+
4545This 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''
46+ you can use it to selectively reset hunks. See the " Interactive Mode"
4747section of linkgit:git-add[1] to learn how to operate the `--patch` mode.
4848
49- ' git reset' [<mode >] [<commit >]::
50- This form resets the current branch head to ` <commit>` and
51- possibly updates the index (resetting it to the tree of ` <commit>` ) and
52- the working tree depending on ` <mode>` . Before the operation, `ORIG_HEAD`
53- is set to the tip of the current branch. If ` <mode>` is omitted,
54- defaults to `--mixed` . The ` <mode>` must be one of the following:
49+ ` git reset [<mode>] [<commit>]` ::
50+ This form resets the current branch head to _ <commit>_ and
51+ possibly updates the index (resetting it to the tree of _ <commit>_ ) and
52+ the working tree depending on _ <mode>_ . Before the operation, `ORIG_HEAD`
53+ is set to the tip of the current branch. If _ <mode>_ is omitted,
54+ defaults to `--mixed` . The _ <mode>_ must be one of the following:
5555+
5656--
57- -- soft::
57+ ` --soft` ::
5858 Does not touch the index file or the working tree at all (but
59- resets the head to ` <commit>` , just like all modes do). This leaves
59+ resets the head to _ <commit>_ , just like all modes do). This leaves
6060 all your changed files "Changes to be committed", as `git status`
6161 would put it.
6262
63- -- mixed::
63+ ` --mixed` ::
6464 Resets the index but not the working tree (i.e., the changed files
6565 are preserved but not marked for commit) and reports what has not
6666 been updated. This is the default action.
6767+
6868If `-N` is specified, removed paths are marked as intent-to-add (see
6969linkgit:git-add[1]).
7070
71- -- hard::
71+ ` --hard` ::
7272 Resets the index and working tree. Any changes to tracked files in the
73- working tree since ` <commit>` are discarded. Any untracked files or
73+ working tree since _ <commit>_ are discarded. Any untracked files or
7474 directories in the way of writing any tracked files are simply deleted.
7575
76- -- merge::
76+ ` --merge` ::
7777 Resets the index and updates the files in the working tree that are
78- different between ` <commit>` and `HEAD` , but keeps those which are
78+ different between _ <commit>_ and `HEAD` , but keeps those which are
7979 different between the index and working tree (i.e. which have changes
8080 which have not been added).
81- If a file that is different between ` <commit>` and the index has
81+ If a file that is different between _ <commit>_ and the index has
8282 unstaged changes, reset is aborted.
8383+
8484In other words, `--merge` does something like a `git read-tree -u -m <commit>` ,
8585but carries forward unmerged index entries.
8686
87- -- keep::
87+ ` --keep` ::
8888 Resets index entries and updates files in the working tree that are
89- different between ` <commit>` and `HEAD` .
90- If a file that is different between ` <commit>` and `HEAD` has local
89+ different between _ <commit>_ and `HEAD` .
90+ If a file that is different between _ <commit>_ and `HEAD` has local
9191 changes, reset is aborted.
9292
93- -- [no-]recurse-submodules::
94- When the working tree is updated, using -- recurse-submodules will
93+ ` --[no-]recurse-submodules` ::
94+ When the working tree is updated, using ` --recurse-submodules` will
9595 also recursively reset the working tree of all active submodules
9696 according to the commit recorded in the superproject, also setting
97- the submodules' HEAD to be detached at that commit.
97+ the submodules' ` HEAD` to be detached at that commit.
9898--
9999
100100See "Reset, restore and revert" in linkgit:git[1] for the differences
@@ -104,31 +104,31 @@ between the three commands.
104104OPTIONS
105105-------
106106
107- -q ::
108- -- quiet::
107+ `-q` ::
108+ ` --quiet` ::
109109 Be quiet, only report errors.
110110
111- -- refresh::
112- -- no-refresh::
111+ ` --refresh` ::
112+ ` --no-refresh` ::
113113 Refresh the index after a mixed reset. Enabled by default.
114114
115- -- pathspec-from-file=<file >::
116- Pathspec is passed in ` <file>` instead of commandline args. If
117- ` <file>` is exactly `-` then standard input is used. Pathspec
118- elements are separated by LF or CR/LF . Pathspec elements can be
115+ ` --pathspec-from-file=<file>` ::
116+ Pathspec is passed in _ <file>_ instead of commandline args. If
117+ _ <file>_ is exactly `-` then standard input is used. Pathspec
118+ elements are separated by _LF_ or _CR_ / _LF_ . Pathspec elements can be
119119 quoted as explained for the configuration variable `core.quotePath`
120120 (see linkgit:git-config[1]). See also `--pathspec-file-nul` and
121121 global `--literal-pathspecs` .
122122
123- -- pathspec-file-nul::
123+ ` --pathspec-file-nul` ::
124124 Only meaningful with `--pathspec-from-file` . Pathspec elements are
125- separated with NUL character and all other characters are taken
125+ separated with _NUL_ character and all other characters are taken
126126 literally (including newlines and quotes).
127127
128- \- - ::
128+ `--` ::
129129 Do not interpret any more arguments as options.
130130
131- <pathspec >... ::
131+ ` <pathspec>...` ::
132132 Limits the paths affected by the operation.
133133+
134134For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
@@ -348,7 +348,7 @@ $ git commit ... <8>
348348------------
349349+
350350 <1> First, reset the history back one commit so that we remove the original
351- commit, but leave the working tree with all the changes. The -N ensures
351+ commit, but leave the working tree with all the changes. The `-N` ensures
352352 that any new files added with `HEAD` are still marked so that `git add -p`
353353 will find them.
354354<2> Next, we interactively select diff hunks to add using the `git add -p`
@@ -458,7 +458,7 @@ working index HEAD target working index HEAD
458458 --keep B C C
459459....
460460
461- `reset --merge` is meant to be used when resetting out of a conflicted
461+ `git reset --merge` is meant to be used when resetting out of a conflicted
462462merge. Any mergy operation guarantees that the working tree file that is
463463involved in the merge does not have a local change with respect to the index
464464before it starts, and that it writes the result out to the working tree. So if
@@ -467,7 +467,7 @@ between the index and the working tree, then it means that we are not
467467resetting out from a state that a mergy operation left after failing
468468with a conflict. That is why we disallow `--merge` option in this case.
469469
470- `reset --keep` is meant to be used when removing some of the last
470+ `git reset --keep` is meant to be used when removing some of the last
471471commits in the current branch while keeping changes in the working
472472tree. If there could be conflicts between the changes in the commit we
473473want to remove and the changes in the working tree we want to keep,
0 commit comments