How do you rename a Git commit pushed to GitHub?

Viewed 44054

I stupidly pushed a commit to GitHub with a very messed up commit name. How do I change this?

Does git commit --amend still work for already pushed commit?

2 Answers

To make changes in already pushed commit, please do that

git reset --soft HEAD~1
git add .
git commit -m "custom message"
git push -u -f origin master
Related