I want to remove several commits and merges from Git. For example, I have 10 commits before and 10 commits after the specific commit I want to remove. I want to delete 4 commits within this range. How can I achieve this?
Here is a picture for furder explination.
https://i.stack.imgur.com/XTRNY.jpg
This issue occurred when I was trying to amend the previous commit, which I had mistyped. Git prompted me to perform a merge, and this is what happened.