git hard checkout master code example
Example: how to reset local master to origin master
git checkout -B master origin/master
//for branch
git checkout -B <branch> origin/<branch>
git checkout -B master origin/master
//for branch
git checkout -B <branch> origin/<branch>