If you want to forcibly move a branch (to undo a merge, for instance): git checkout f4523f9 # ignore the complaint about "detached HEAD" git branch -f master f4523f9 git checkout master This moves the branch "master" to the revision-ID f4523f9.