Editing a Commit in Git
When working on a project in the Git system, sometimes situations arise when a commit is sent incorrectly: for example, prematurely or with an incorrect comment. Git has the ability to send a corrected commit, which will be accepted instead of the previous commit.
To do this, first make your edits, stage them, and then run commit, but with the --amend flag:
git commit --amend
Deliberately push the wrong commit, then push the correct one.