Fixing Corrupt Git Branch

From eqqon

(Difference between revisions)
Jump to: navigation, search
Henon (Talk | contribs)
(New page: 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...)
Newer edit →

Revision as of 12:54, 3 August 2009

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