git 撤销本地commit
1. 查看历史版本记录: git reflog
2. 回退
- 放弃或回滚本次提交:git reset --hard commitId (删除工作空间的改动代码,撤销commit且撤销add)
- 回退到上次提交不清除本地提交的代码: git reset --soft commitId (不删除工作空间的改动代码 ,撤销commit,不撤销add)
commitId为想要回退的版本号
1. 查看历史版本记录: git reflog
2. 回退
commitId为想要回退的版本号