How do I reset my local branch to be just like the branch on the remote repository?
I did:
git reset --hard HEAD
But when I run a <
git reset --hard HEAD
actually only resets to the last committed state. In this case HEAD refers to the HEAD of your branch.
If you have several commits, this won't work..
What you probably want to do, is reset to the head of origin or whatever you remote repository is called. I'd probably just do something like
git reset --hard origin/HEAD
Be careful though. Hard resets cannot easily be undone. It is better to do as Dan suggests, and branch off a copy of your changes before resetting.