We can use git commit --amend command to change the most recent commit message.
git commit --amend -m "{NEW_MESSAGE}In this case, we can only edit the most recent commit message and force push it to remote -
git commit --amend -m "{NEW_MESSAGE}"
git push --forceNote: Force Pushes can break things, so warnings ahead!
Source: Linuxize