views:

22

answers:

1

I have a repository that i pulled the changes for, so now it is up to date with the remote repository. Except that now i realized that i needed to pull all of that repositories changes and keep none of mine. I want to go back in history so that i won't get an "Already up-to-date" when i pull. Also part two, how can i pull and get all of their changes keeping none of mine?

+2  A: 
git reset --hard origin/otherbranchname

Assumes: You are on the branch you want to move, the remote is called origin, and you really want to blow away all of your commits.

git reset moves branch pointers around. This command simply plucks it from its current location and places it at the remotes' branch pointer, while changing all of the working copy files.

Yann Ramin