git log
.....
input q can quit this status
git add .
git commit -m"change1"
git commit --amend
come to vim edit
can press a ,i or o to edit
//if you want to save and quit can press ESC and input :wq
//if you want to quit but not save this edit can press ESC and input :q!
to cancel add . and commit by use follow code
git reset --soft HEAD^ only cancel commit
git status can show add file
git reset --mixed HEAD^ cancel commit and add ,but code you have change is reserve
***!!
git reset --hard HEAD^ cancel commit and add ,attention,code you have change
also cancel so is come to last time you commit.
git reset --hard HEAD~3 Fall back to before the last three commuits
git push origin HEAD --force force to origin brnach