Error in documentation for @{-n} in gitrevisions
From: Kevin <hidden>
Date: 2016-06-15 22:59:38
While discussing the behavior of "git checkout -", I apparently was
confused because the documentation states:
The construct @{-<n>} means the <n>th branch checked out before the
current one.
But experimenting with it, it also takes you back to previously
checkout commits.
git-checkout-at-minus-one :: (master) » git checkout origin/master
Note: checking out 'origin/master'.
HEAD is now at f8b2f0c... two
git-checkout-at-minus-one :: (f8b2f0c) » git checkout -
Switched to branch 'master'
git-checkout-at-minus-one :: (master) » git checkout -
Note: checking out
'f8b2f0c1419d1fe798159c2c2578d2dbe1323148'.
HEAD is now at f8b2f0c... two
Either the documentation is wrong, and should be changed to "<n>th
branch/commit checkout out before the current one", or the behavior of
@{-1} is wrong.