Reset local repo to be exactly the same as remote repo

Solution 1:

git reset --hard HEAD^ will only reset your working copy to the previous (parent) commit. Instead, you want to run

git reset --hard origin/master

Assuming remote is origin and the branch you want to reset to is master

Solution 2:

You could delete the current branch, and create the branch again at the remote/branchname commit

git branch -D branchname
git checkout remote/branchname
git branch branchname