Update your last wrong commit message with the new commit message in one line:
git commit --amend -m "your new commit message"
Or, try Git reset like below:
# You can reset your head to n number of commit
# NOT a good idea for changing last commit message,
# but you can get an idea to split commit into multiple commits
git reset --soft HEAD^
# It will reset you last commit. Now, you
# can re-commit it with new commit message.
Using reset to split commits into smaller commits
git reset
can help you to break one commit into multiple commits too:
# Reset your head. I am resetting to last commits:
git reset --soft HEAD^
# (You can reset multiple commit by doing HEAD~2(no. of commits)
# Now, reset your head for splitting it to multiple commits
git reset HEAD
# Add and commit your files separately to make multiple commits: e.g
git add app/
git commit -m "add all files in app directory"
git add config/
git commit -m "add all files in config directory"
Here you have successfully broken your last commit into two commits.