If you don't want to deal with interactive mode then do this:
Update your last pushed commit
git commit --amend -m "New commit message."
Push your new commit message (this will replace the old last commit message to this new one)
git push origin --force **branch-name**
More on this - https://linuxize.com/post/change-git-commit-message/