Overwriting my local branch with remote branch

The Solution to Overwriting my local branch with remote branch is


first, create a new branch in the current position (in case you need your old 'screwed up' history):

git branch fubar-pin

update your list of remote branches and sync new commits:

git fetch --all

then, reset your branch to the point where origin/branch points to:

git reset --hard origin/branch

be careful, this will remove any changes from your working tree!

~ Answered on 2011-06-03 16:20:39


Most Viewed Questions: