git 回退版本
1. 查看提交历史
$ git log
–
// 查看每一次命令记录 git reflog
2. 查看提交历史
$ git reset --hard 0afbc228ff7e5568303e6f9a52b7146973a3e672
–
// git reset --hard 版本号 :回退到指定版本, git reset --hard 0afbc228ff7e5568303e6f9a52b7146973a3e672
3. 提交
$ git push -f
–
// 将回退的后版本强推到远程主机。此时如果用“git push”会报错,因为我们本地库HEAD指向的版本比远程库的要旧