Git

rebase

Insert a commit after C [1] :

git checkout C
git checkout -b insert
git add ...
git commit -m 'New commit'
git rebase --onto insert C main

References

  1. Inserting a new commit in the Git history