码迷,mamicode.com
首页 > 其他好文 > 详细

[Git] Use and Compare the Different git Reset Options: --hard, --soft, and --mixed

时间:2020-01-08 21:04:23      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:class   keep   span   git reset   lag   hang   different   undo   bsp   

git reset has three primary options that we might use: --soft--hard and --mixed (the default).

We‘ll use git reset to undo the latest commit in all three ways, and compare the result of reseting with each flag.

 

git reset --soft HEAD~1 // keep staging but remove commit

git reset --mixed HEAD~1 // remove staging and commit, but keep the changes

git reset --hard HEAD~1  // remove the changes, commit, and staging

 

[Git] Use and Compare the Different git Reset Options: --hard, --soft, and --mixed

标签:class   keep   span   git reset   lag   hang   different   undo   bsp   

原文地址:https://www.cnblogs.com/Answer1215/p/12168631.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!