Let's say I have a commit history 126.96.36.199.5.6 How do I remove 3 commit to 1.2 and 4.5.6 is not affected?
Just when I do a pull-request in the middle of the commit history and merge is a commit which I don't need rollback lost commits in front standing.
Do a rebase -i to the parent of the commit that removed. git rebase -i 6159eb3~
A box will open in which you will need to delete the line with the commit 6159eb3.
After deleting save and exit.
Remember that rebase creates all the commits again, so it can be used before one of your commits are not uploaded to yourself, otherwise they will have duplicate copies of the same commits with different hashes.