- 直接回退到上個(gè)版本
git log
git reset --hard <commit id>
會(huì)退到上個(gè)版本抡爹,但是不會(huì)保留之前的修改
- 回到上個(gè)版本挑辆,并且保留在 index 緩存區(qū)
git log
git reset --soft <commit id>
- 回到上個(gè)版本是复,但是不保留在 index 緩存區(qū)
git log
git reset --mixed <commit id>
git log
git reset --hard <commit id>
會(huì)退到上個(gè)版本抡爹,但是不會(huì)保留之前的修改
git log
git reset --soft <commit id>
git log
git reset --mixed <commit id>