@matheusbsbs / matheus-bagliano / commits / 965053b09a
Fork 0

Documentation/git-reset: Add an example of resetting selected paths

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pieter de Bie committed Feb 16, 2008 at 17:48 UTC 965053b09a2de5687b9098cb05edc9bfbf1d26b3
1 file changed +17
Documentation/git-reset.txt
+17
@@ -176,6 +176,23 @@ $ git reset <3>
176 committed as 'snapshot WIP'. This updates the index to show your
177 WIP files as uncommitted.
178
179 +Reset a single file in the index::
180 ++
181 +Suppose you have added a file to your index, but later decide you do not
182 +want to add it to your commit. You can remove the file from the index
183 +while keeping your changes with git reset.
184 ++
185 +------------
186 +$ git reset -- frotz.c <1>
187 +$ git commit -m "Commit files in index" <2>
188 +$ git add frotz.c <3>
189 +------------
190 ++
191 +<1> This removes the file from the index while keeping it in the working
192 + directory.
193 +<2> This commits all other changes in the index.
194 +<3> Adds the file to the index again.
195 +
196 Author
197 ------
198 Written by Junio C Hamano <junkio@cox.net> and Linus Torvalds <torvalds@osdl.org>