I had some old changes on one of my git branches today that I wanted to get rid of, they had been staged but I didn't need them. The easiest thing to do was just overwrite the local master branch with what is on the remote.
I tried the command: git reset --hard origin master
To which Git informed me - fatal: Cannot do hard reset with paths
I figured out the problem was a missing / between origin and master, the actual command I needed was git reset --hard origin/master which git was much happier with.
This did lead me to question, however, what the difference is between origin master and origin/master?
After some background reading I discovered this is actually 3 things.
origin, the remote repository name.
master, the remote branch name.
origin/master, the cached local copy of the the origin master remote branch.
So in typing: git reset --hard origin master I was incorrectly attempting to overwrite the remote master branch, hence the fatality :)
Using origin/master gets me back to my local branch and back to where I wanted to be with a direct replication of what was current on the origin master remote.
Clear as Mud....