index 168333a588e0828d2d14687774fd41cc57f43721..3bccffae628e065a6cd92155a9283d5710991fd7 100644 (file)
When <paths> are given, this command does *not* switch
branches. It updates the named paths in the working tree from
When <paths> are given, this command does *not* switch
branches. It updates the named paths in the working tree from
-the index file, or from a named commit. In
+the index file, or from a named <tree-ish> (most often a commit). In
this case, the `-b` options is meaningless and giving
either of them results in an error. <tree-ish> argument can be
used to specify a specific tree-ish (i.e. commit, tag or tree)
this case, the `-b` options is meaningless and giving
either of them results in an error. <tree-ish> argument can be
used to specify a specific tree-ish (i.e. commit, tag or tree)
+
When this parameter names a non-branch (but still a valid commit object),
your HEAD becomes 'detached'.
+
When this parameter names a non-branch (but still a valid commit object),
your HEAD becomes 'detached'.
++
+As a special case, the "`@\{-N\}`" syntax for the N-th last branch
+checks out the branch (instead of detaching). You may also specify
+"`-`" which is synonymous with "`@\{-1\}`".
Detached HEAD
Detached HEAD
------------
$ git checkout -m mytopic
Auto-merging frotz
------------
$ git checkout -m mytopic
Auto-merging frotz
-merge: warning: conflicts during merge
ERROR: Merge conflict in frotz
fatal: merge program failed
------------
ERROR: Merge conflict in frotz
fatal: merge program failed
------------