I ended up with a detached head today, the same problem as described in: git push says everything up-to-date even though I have local changes
As far as I know I didn
When you checkout to a commit git checkout
or to a remote branch your HEAD will get detached and try to create a new commit on it.
Commits that are not reachable by any branch or tag will be garbage collected and removed from the repository after 30 days.
Another way to solve this is by creating a new branch for the newly created commit and checkout to it. git checkout -b
This article illustrates how you can get to detached HEAD state.