git commit head re code example
Example 1: git set head to commit
# Set a new HEAD to a branch
# Note that commit can be a commit hash or tag or another branch
git reset --hard $COMMIT
Example 2: command to find out my git head version
$ git show-ref --head --dereference
832e76a9899f560a90ffd62ae2ce83bbeff58f54 HEAD
832e76a9899f560a90ffd62ae2ce83bbeff58f54 refs/heads/master
832e76a9899f560a90ffd62ae2ce83bbeff58f54 refs/heads/origin
3521017556c5de4159da4615a39fa4d5d2c279b5 refs/tags/v0.99.9c
...