There seems to be a difference between the last commit, the HEAD and the state of the file I can see in my directory.
What is HEAD, what can I do with it and what mi
Basically HEAD is a pointer/reference which points to the last commit in the current branch.
You can use these two commands to verify this.
$ git log -1
commit 9883e13257f2e7555eb6e3b14b2c814978c75692 (HEAD -> MyLocalBranch)
Author: vikram
Date: Sun Oct 11 23:32:45 2020 -0400
this is my last commit message
Now use below command to see where HEAD is pointing:
$ git rev-parse HEAD
9883e13257f2e7555eb6e3b14b2c814978c75692
As you can see that these two commit hashes are the same. So HEAD always points to the latest/last commit in the current branch.