Once you click on the repo, you really don't want to change the story. However, if you are absolutely sure that no one pulled / extracted from the repo from your abusive commit, you have 2 options.
If you want to completely remove the commit (and every commit that comes after that), do git reset --hard ABC~ (assuming the hash is ABC commit). Then do a git push -f .
If you just want to edit this message and save the commits that came after it, do git rebase -i ABC~ . This will launch your editor, showing a list of your commits, starting with the offensive. Change the pick flag to e, save the file and close the editor. Then make the necessary changes to the files and do git commit -a --amend , then do git rebase --continue . Follow it with git push -f .
I want to repeat, these options are only available to you if no one has done pull or fetch containing your abusive commit. If they do, following these steps will only worsen the situation.
source share