Last Updated: February 25, 2016
·
947
· alroman

Fixing a diverged local master branch

Should your local master diverge from (Github) master branch, this is a way to resolve what ails you:

$ git rebase origin/master

That will do the expected rewind + patch your changes on top. But if things have diverged to the point where they cannot be reconciled, you might need to blow up your local changes. You can do it like so:

$ git reset --hard origin/master

And your branch is gone! Let's hope that Github tells the truth.