Git: Discard all changes on a diverged local branch
Solution 1:
git checkout phobos
git reset --hard origin/phobos
This tells Git to reset the head of phobos
to the same commit as origin/phobos
, and to update the working tree to match.
Solution 2:
Delete the branch, then re-create it:
$ git branch -D phobos
$ git checkout --track -b phobos origin/phobos