Sourcetree: how to revert a git pull

I have a local repository under Sourcetree for Mac, which is tracking the master branch of a remote repository. I tried importing a branch that is in the remote repo but not in my local one, so I picked it under the "Remotes" label and pressed "Pull"… but it looks like it pulled and merged the changes in that branch into my local master. Now I have in my master a message that says "6 ahead" , and a badge in my "Push" button asking me to push those 6 changes into the remote master.

I don't want to do that; I want to discard those 6 changes and leave my local master as it was. After searching, the suggested solution seems to be to pick the commit in question and right-click to "Reset master to this commit", but it didn't do the trick; the pending commits still appear in the "Push" button. What can I do?

(I don't have git installed on this machine, only Sourcetree, so a Sourcetree-only solution would be preferred).

链接地址: http://www.djcxy.com/p/94782.html

上一篇: Git回滚到之前的结帐

下一篇: Sourcetree:如何恢复git pull