How HEAD works in git

jvns