0

I pull a wrong remote branch to local i.e Merge branch 'remote' of ://github.../remote into Local

A right click in TortoiseGit -> Revert changes by this commit is requesting to revert to either "parent 1" or "parent 2". I simply want to cancel the pull remote into local, what should chose ?

DKK
  • 1,870
  • 4
  • 15
  • 22

1 Answers1

0
  1. Find the original commit your branch was on before you pulled.

ORIG_HEAD points to the original head of a branch before it was changed in a drastic way. "Drastic" means something more than a simple commit, like git reset or git pull. Verify ORIG_HEAD points at your pre-pull commit with git log ORIG_HEAD.

If it isn't, you can use git log --graph --decorate to find the commit before the pull. Or you can use git reflog to look at where HEAD was every time it changed.

  1. Reset the branch.

Assuming it's ORIG_HEAD: git reset --hard ORIG_HEAD

This will move the branch back to the specified commit as if the pull never happened.

Schwern
  • 153,029
  • 25
  • 195
  • 336