It says "by 0 commits" when going back from detached HEAD to master branch: $ git checkout HEAD^ $ git checkout master Previous HEAD position was af4c62a... Merge branch 'maint' Switched to branch 'master' Your branch is ahead of 'origin/master' by 0 commits. ^^^^^^^^^^^^ $ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. ^^^^^^^^^^^ # nothing to commit (working directory clean) -- Piotr Krukowiecki -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html