I was accidentally working on a branch I shouldn\'t have been for a while, so I branched off of it giving it the appropriate name. Now I want to overwrite the branch I shou
There is a slightly easier way to do this:
git reset --hard @{u}
@{u} is a shortcut for whatever your tracking branch is, so if you're on master and that tracks origin/master, @{u} points to origin/master.
The advantage of using this is that you don't have to remember (or type out) the full name of your tracking branch. You can also make an alias:
git-reset-origin="git reset --hard @{u}"
which will work regardless of the branch you're currently on.