One way to end up in this situation is after doing a rebase from a remote branch. In this case, the new commits are pointed to by HEAD
but master
does not point to them -- it's pointing to wherever it was before you rebased the other branch.
You can make this commit your new master
by doing:
git branch -f master HEAD
git checkout master
This forcibly updates master
to point to HEAD
(without putting you on master
) then switches to master
.