Add another way to change commit message.

This commit is contained in:
Bo-Yi Wu 2015-09-04 08:55:25 +08:00
parent d417eedd3b
commit 184bcc1ddf
1 changed files with 7 additions and 0 deletions

View File

@ -74,6 +74,13 @@ If you wrote the wrong thing and the commit has not yet been pushed, you can do
$ git commit --amend
```
The another way to change commit message:
```sh
$ git reset --soft HEAD^
$ git commit -a -m 'xxxxxxx'
```
If you have already pushed the message, you can amend the commit and force push, but this is not recommended.
## I need to add staged changes to the previous commit