How to remove a specific commit?

Let's say I have a commit history 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.
July 8th 19 at 15:47
1 answer
July 8th 19 at 15:49
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.
I understand this locally? And on github how to remove those commits? - ezekiel_Gaylord commented on July 8th 19 at 15:52
: on github you need to do a commit cancel commit. (Usually do so.) So you make a commit that deletes the changes of that commit, and there you write, why delete. On github you can't control, downloaded anyone your commit that you want to delete. So, to others not to break everything, you would add them as new developments. If you got no one swung anything, then you can do manipulation of the branches to upload a branch to delete a branch, rename branch - but it is better to learn to do everything correctly from the start, but in real life it would be this through adding information. - Ramon.Stracke commented on July 8th 19 at 15:55

Find more questions by tags GitLabGitBitbucketGitHub