We can update last commit log using
--amend option in git commit. Use the following command to do it but remember that if some other has already sync your changes then they again need to sync your code to avoid any future problems related to this.
git commit --amend-m "Your updated commit message"
This will change the last commit message in your local repository. But if you have already pushed your changes to remote branches, Then you also need to push your changes again to remote server forcefully.
For example, you need to push changes in the master branch of remote origin.
git push origin master --force