@@ -86,6 +86,29 @@ OPTIONS
86
86
EXAMPLES
87
87
--------
88
88
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
+
89
112
Undo a commit and redo::
90
113
+
91
114
------------
@@ -133,29 +156,6 @@ current HEAD.
133
156
<2> Rewind the master branch to get rid of those three commits.
134
157
<3> Switch to "topic/wip" branch and keep working.
135
158
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
-
159
159
Undo a merge or pull::
160
160
+
161
161
------------
0 commit comments