+20  A: 

git pull will do two things: it does a git fetch and then a git merge where it merges branches that have been setup to be merged in your config.

So what you want to do is to undo the merge (undoing the fetch doesn't make a lot of sense and shouldn't be necessary).

To do that you can try using git reset --hard to reset to a previous state. Use the git-reflog command to find the SHA-1 of the previous state and then reset to it.

jkp
Thanks, you saved my day :)
seg.server.fault
An excellent way to pick the previous state, instead of using git-reflog and copying hashes, is to use a shortcut like `master@{1}`, which is the previous position of `master`, `master@{"5 minutes ago"}`, or `master@{14:30}`. Full details on specifying revisions in this way can be found in `man git-rev-parse`, in the section called "specifying revisions".
Jefromi
In this case ORIG\_HEAD should also work ("git reset --hard ORIG\_HEAD")
Jakub Narębski
@Jelfromi: thanks for that tip, I wasn't aware you could be so verbose about revisions. I knew about picking revisions relative to HEAD, but when the question was posed I didn't knowhow far back in time he wanted to go.
jkp
Saved my ass too. I really hate git.
apphacker
+4  A: 

If you have gitk (try running "gitk --all from your git command line"), it's simple. Just run it, select the commit you want to rollback to (right-click), and select "Reset master branch to here". If you have no uncommited changes, chose the "hard" option.

Samuel Carrijo
No, I havent commited anything just did git pull only.
seg.server.fault
git-pull autocommits.
Don Branson
Thanks, it worked now.
seg.server.fault