I have two tags on a branch. Whenever I do git reset old_tag
it changes the head to the old_tag
and says that I'm behind by 1 commit (which is expected). However, git checkout old_tag
gives a detached head.
As far as I understand, git reset
only changes the head pointer. As for git checkout
I use it always to switch branches or checkout a certain commit in a new branch. But I never used it to checkout a commit all by itself without a branch. So, if it will always give a detached head, why is it allowed to checkout a commit by itself in the first place?
Update: The bold part is the difference between my question and the referred duplicate question.