If you need to change the commit message after a push , it is possible !! let see the next example :
git commit --amend -m "New commit message"
Using the –amend we ask git to modify the last commit message. To confirm this modification we have to push :
git push --force origin <BRANCH-NAME>
This solution is working only if we need to modify the message of the last pushed commit and not an old commit !!
Also learn How To Switch Branch on Git ?