HEAD - The "You Are Here" Marker
CheckoutHEAD is Git's "you are here" marker. It follows the branch you currently have checked out, and switching branches moves HEAD from one branch label to another.
Core Git 4/8
HEAD tells Git what is currently checked out. Most of the time HEAD points to a branch name, so switching branches moves HEAD and changes your working context. Sometimes HEAD points directly to a commit instead, which is called detached HEAD mode and is useful for safe inspection of older history.
Back to Git Concepts overviewHEAD is Git's "you are here" marker. It follows the branch you currently have checked out, and switching branches moves HEAD from one branch label to another.
In detached HEAD state, HEAD points directly to a commit instead of to a branch label. This is useful for temporary inspection, but commits you make here are not on a branch unless you create one.