Take the 2-minute tour ×

I have accidentally pushed changes from the wrong branch of my development repo to my central repo and then continued to pull these to my released repo.

Using git reset --hard [SHA1] I have returned my released repo to the correct place. I tried doing this to the origin too and now when i go git log in the central repo; i get: fatal:bad default revision 'HEAD'

I would like to know how to sort out the HEAD situation and also how to get back to the point before pushing from my development repo, thanks

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The error is normal when you try git log in a remote repo because they are usually bare repositories. Here is a good explanation.

Now that you've reset --hard the local repo to the correct state, it seems that what you want now is to replicate this state in the remote repo. If so, just force push your branches to the origin.

git push -f origin <branch-name>

Beware that force pushing may cause problems if some people have already pulled the bad revisions from the remote.

share|improve this answer
add comment

Your Answer


