Check out example codes for "change commit message". It will help you in understanding the concepts better.

Code Example 1

$ git commit --amend -m "New and correct message"

Code Example 2

$ git commit --amend -m "New and correct message"

Code Example 3

git commit --amend -m "New commit message"

Code Example 4

# Displays a list of the last commits
# Just replace a name with another one and save and close the file
git rebase -i HEAD~3

Code Example 5

git commit --amend
// press enter, editor would open

Code Example 6

git commit --amend -m "New commit message."

Learn ReactJs, React Native from akashmittal.com