Last active: 2 years ago
fix Git HEAD without a branch
By force pushing the branch to remote, but local HEAD still without a branch.
git push origin HEAD:master --force
A less risky solution would be to create a temporary branch from the detached HEAD, and then merge that branch into master:
git branch temp-branch
git checkout master
git merge temp-branch
git push origin master