Fixing Corrupt Git Branch

From eqqon

Jump to: navigation, search

Say, you corrupted your github repository (i.e. by playing around with the fork queue =P) and want to reset your remote repository to a certain point in your history that is still ok (commit with hash xxxx)

Reset local head to that commit (replace xxxx with commit hash):

git reset --hard xxxx

Delete corrupt remote branch

git push origin :master

Recreate remote branch with your fixed one

git push origin master