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 <
If you had a problem as me, that you have already committed some changes, but now, for any reason you want to get rid of it, the quickest way is to use git reset
like this:
git reset --hard HEAD~2
I had 2 not needed commits, hence the number 2. You can change it to your own number of commits to reset.
So answering your question - if you're 5 commits ahead of remote repository HEAD, you should run this command:
git reset --hard HEAD~5
Notice that you will lose the changes you've made, so be careful!