1撤销上次提交
git reset --soft HEAD~ 撤回commit操作,您写的代码仍然保留。如果是--hard 你本地代码将不再保留
2合并上次提交
将多次提交合并成一次提价 git commit --amend
3将本地代码暂存
git stash 取出可以通过git stash pop
4回退到某个版本
git reset --hard commitID
5将远程某个patch应用到本地改变
git cherry-pick commitID
6,将某一次提交commit生成patch
git format-patch -1