Fixing Corrupt Git Branch
From eqqon
Say you corrupted your branch 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