1

enter image description here

I want to reset the changes on the gray path, (origin/master) and keep what I have in the blue line (master). How do I do this?

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34

1 Answers1

2

Your blue line is "master" branch, which local. The grey line is pushed to the remote, hence the top commit is "remote/master". To sync them up do a "force push" your local to the remote. This will rewrite the remote history.

If both lines were local branches, e.g. the grey line was "branch1", then you could have just do a "hard reset" from one to another.

And lastly, if you can always turn on "reflogs" (under View menu) to see all commits that are no longer referenced by any other 'ref' such as branch or tag.

RussKie
  • 1,630
  • 11
  • 20