Git restore branch with changed history

42 Views Asked by At

I created a branch

git checkout -b myBranch

I made 3 commits onto the branch, lets name then One, Twoand Three.

I did an interactive rebase.

git rebase -i origin/master

With

pick One
drop Two
drop Three

and after dropping Two and Three I did a force push:

git push -f

I lost access to the local branch and just have access to origin.

Gitlab shows the hash ID of 'Three'. Still even I am not able to checkout the Three commit being child of Two.

After a new clone of the branch git reflog does not show relevant commit of Three. I assume because the history has changed on origin.

0

There are 0 best solutions below