I was working with git and created an unnecessary situation by accident. This is how my git history looks like:
You can use
rebase for this. It will essentially reset the branch to a point you specify, then replay commits over the top again the way you tell it to. In this case you'll exclude commit C:
git rebase -i HEAD~5 # 5 is the number of commits back to rebase # Comment out or delete the line for commit C # Save/proceed
As you noted, you don't care about preserving the history. This process will change the commit hashes for the commits after C.