I have two branches:
- local branch (the one which I work with)
- remote branch (public, only well-tested commits go there)
Recently I seriously messed up my local branch.
How would I replace the local branch entirely with the remote one, so I can continue my work from where the remote branch is now?
I have already searched SO and checking out to the remote branch locally does not have any effect.
Assuming that master is the local branch you’re replacing, and that “origin/master” is the remote branch you want to reset to:
This updates your local HEAD branch to be the same revision as origin/master, and
--hardwill sync this change into the index and workspace as well.