Earlier quoted context omitted.
I don't know much about git but I just do git reset --soft HEAD~n where n is the number of commits I want to undo. Known issue: can't undo all the commits.
git reset --hard origin/master just deletes all your local work on the current branch.
Git switch is also something I learned recently so sometimes I type checkout because of force of habit but I am trying to do better (even though I'm not sure what switch dies that checkout can't but don't want to get into arguments, just want to do things the prescribed way).