Code

Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk
[git.git] / Documentation / git-reset.txt
index b27399dd419d3b673e230fd3aad21a8e5c1b2e09..19c5b9bbda60744723e453dceaa209c47a49cb60 100644 (file)
@@ -7,7 +7,9 @@ git-reset - Reset current HEAD to the specified state
 
 SYNOPSIS
 --------
-'git-reset' [--mixed | --soft | --hard] [<commit-ish>]
+[verse]
+'git-reset' [--mixed | --soft | --hard] [<commit>]
+'git-reset' [--mixed] <commit> [--] <paths>...
 
 DESCRIPTION
 -----------
@@ -21,25 +23,29 @@ the undo in the history.
 If you want to undo a commit other than the latest on a branch,
 gitlink: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.
+
+
 OPTIONS
 -------
 --mixed::
-       Resets the index but not the working tree (ie, the changed files
+       Resets the index but not the working tree (i.e., the changed files
        are preserved but not marked for commit) and reports what has not
        been updated. This is the default action.
 
 --soft::
        Does not touch the index file nor the working tree at all, but
        requires them to be in a good order. This leaves all your changed
-       files "Updated but not checked in", as gitlink:git-status[1] would
+       files "Added but not yet committed", as gitlink:git-status[1] would
        put it.
 
 --hard::
        Matches the working tree and index to that of the tree being
        switched to. Any changes to tracked files in the working tree
-       since <commit-ish> are lost.
+       since <commit> are lost.
 
-<commit-ish>::
+<commit>::
        Commit to make the current HEAD.
 
 Examples
@@ -61,6 +67,8 @@ message, or both.  Leaves working tree as it was before "reset".
 <3> "reset" copies the old head to .git/ORIG_HEAD; redo the
 commit by starting with its log message.  If you do not need to
 edit the message further, you can give -C option instead.
++
+See also the --amend option to gitlink:git-commit[1].
 
 Undo commits permanently::
 +
@@ -88,11 +96,11 @@ current HEAD.
 <2> Rewind the master branch to get rid of those three commits.
 <3> Switch to "topic/wip" branch and keep working.
 
-Undo update-index::
+Undo add::
 +
 ------------
 $ edit                                     <1>
-$ git-update-index frotz.c filfre.c
+$ git add frotz.c filfre.c
 $ mailx                                    <2>
 $ git reset                                <3>
 $ git pull git://info.example.com/ nitfol  <4>
@@ -115,10 +123,6 @@ Undo a merge or pull::
 +
 ------------
 $ git pull                         <1>
-Trying really trivial in-index merge...
-fatal: Merge requires file-level merging
-Nope.
-...
 Auto-merging nitfol
 CONFLICT (content): Merge conflict in nitfol
 Automatic merge failed/prevented; fix up by hand