Skip to content

Commit 8bb95bb

Browse files
trastgitster
authored andcommitted
Documentation/reset: reorder examples to match description
A previous commit moved the <paths> mode (undoes git-add) to the front in the description, so make the examples follow the same order. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 28bb4b2 commit 8bb95bb

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Documentation/git-reset.txt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,29 @@ OPTIONS
8686
EXAMPLES
8787
--------
8888

89+
Undo add::
90+
+
91+
------------
92+
$ edit <1>
93+
$ git add frotz.c filfre.c
94+
$ mailx <2>
95+
$ git reset <3>
96+
$ git pull git://info.example.com/ nitfol <4>
97+
------------
98+
+
99+
<1> You are happily working on something, and find the changes
100+
in these files are in good order. You do not want to see them
101+
when you run "git diff", because you plan to work on other files
102+
and changes with these files are distracting.
103+
<2> Somebody asks you to pull, and the changes sounds worthy of merging.
104+
<3> However, you already dirtied the index (i.e. your index does
105+
not match the HEAD commit). But you know the pull you are going
106+
to make does not affect frotz.c nor filfre.c, so you revert the
107+
index changes for these two files. Your changes in working tree
108+
remain there.
109+
<4> Then you can pull and merge, leaving frotz.c and filfre.c
110+
changes still in the working tree.
111+
89112
Undo a commit and redo::
90113
+
91114
------------
@@ -133,29 +156,6 @@ current HEAD.
133156
<2> Rewind the master branch to get rid of those three commits.
134157
<3> Switch to "topic/wip" branch and keep working.
135158

136-
Undo add::
137-
+
138-
------------
139-
$ edit <1>
140-
$ git add frotz.c filfre.c
141-
$ mailx <2>
142-
$ git reset <3>
143-
$ git pull git://info.example.com/ nitfol <4>
144-
------------
145-
+
146-
<1> You are happily working on something, and find the changes
147-
in these files are in good order. You do not want to see them
148-
when you run "git diff", because you plan to work on other files
149-
and changes with these files are distracting.
150-
<2> Somebody asks you to pull, and the changes sounds worthy of merging.
151-
<3> However, you already dirtied the index (i.e. your index does
152-
not match the HEAD commit). But you know the pull you are going
153-
to make does not affect frotz.c nor filfre.c, so you revert the
154-
index changes for these two files. Your changes in working tree
155-
remain there.
156-
<4> Then you can pull and merge, leaving frotz.c and filfre.c
157-
changes still in the working tree.
158-
159159
Undo a merge or pull::
160160
+
161161
------------

0 commit comments

Comments
 (0)