0

So I did a "git rebase interactively" in SourceTree, and the result wasn't exactly as expected.

Result:

enter image description here

Intended / wanted situation (ms-paint'ed):

enter image description here

In other words i want to

  • Move the branch point to after commit c4d389e
  • Move commit 5a57dea to after c4d389e on the main branch
  • delete commits 474e72f, b61bbf50 on the shadow branch as they will be duplicates after moving the branching point, and delete afba1b9 and 0f2b626 as they have no business on the shadow branch

I haven't pushed the commits to any remote repo.

Can anyone please tell me what steps I need to do? Iv'e seen the big Undoing a git rebase-thread, but I don't really understand how to apply the answers to this particular situation.

Community
  • 1
  • 1
Nilzor
  • 18,082
  • 22
  • 100
  • 167
  • That post has all the answers you need. Instead of linking your own duplicate, take the time to read and understand it. You're just going to get the same answers here. – user229044 Aug 08 '14 at 13:00
  • @meagar He even mentioned the question in his post and said that there were understanding problems. So just pointing to this question isn't quite helpful. – Sascha Wolf Aug 08 '14 at 13:01
  • Although I agree that the question contains all important information. – Sascha Wolf Aug 08 '14 at 13:01
  • Ok just close this question I think I got it... – Nilzor Aug 08 '14 at 13:03
  • @Nilzor You can use `reflog` on branches too, so `git reflog master` should give you sufficient information about the commit in question. Then you just can use `git reset --hard master master@{}` to reset master to the old commit before the rebase. – Sascha Wolf Aug 08 '14 at 13:05

0 Answers0