path: root/Documentation/git-reset.txt
diff options
authorThomas Rast <>2009-08-15 11:48:31 (GMT)
committerJunio C Hamano <>2009-08-15 22:17:47 (GMT)
commitd002ef4d9446b9fe4d0c397131edce58781df2f1 (patch)
tree50edd9828af40f2786937af4cd72b83c63b6ef14 /Documentation/git-reset.txt
parent46b5139cae7306194a39fdaf5c6abc12ab531c84 (diff)
Implement 'git reset --patch'
This introduces a --patch mode for git-reset. The basic case is git reset --patch -- [files...] which acts as the opposite of 'git add --patch -- [files...]': it offers hunks for *un*staging. Advanced usage is git reset --patch <revision> -- [files...] which offers hunks from the diff between the index and <revision> for forward application to the index. (That is, the basic case is just <revision> = HEAD.) Signed-off-by: Thomas Rast <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-reset.txt')
1 files changed, 13 insertions, 2 deletions
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index abb25d1..469cf6d 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -10,6 +10,7 @@ SYNOPSIS
'git reset' [--mixed | --soft | --hard | --merge] [-q] [<commit>]
'git reset' [-q] [<commit>] [--] <paths>...
+'git reset' --patch [<commit>] [--] [<paths>...]
@@ -23,8 +24,9 @@ the undo in the history.
If you want to undo a commit other than the latest on a branch,
linkgit:git-revert[1] is your friend.
-The second form with 'paths' is used to revert selected paths in
-the index from a given commit, without moving HEAD.
+The second and third forms with 'paths' and/or --patch are used to
+revert selected paths in the index from a given commit, without moving
@@ -50,6 +52,15 @@ OPTIONS
and updates the files that are different between the named commit
and the current commit in the working tree.
+ Interactively select hunks in the difference between the index
+ and <commit> (defaults to HEAD). The chosen hunks are applied
+ in reverse to the index.
+This means that `git reset -p` is the opposite of `git add -p` (see
Be quiet, only report errors.