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

git放弃本地commit,未push

时间:2018-04-06 18:34:57      阅读:257      评论:0      收藏:0      [点我收藏+]

标签:--   post   git reset   bsp   _id   一个   步骤   push   应该   

如果不小心commit了一个不应该commit的修改,但是还没有push,想撤销那个commit。

步骤:

a) git log:获取commit id;

b) git reset --hard commit_id:即:git reset --hard d1a65e9ac9a7c4396206f0072b7fbc9138a26c1f 

git放弃本地commit,未push

标签:--   post   git reset   bsp   _id   一个   步骤   push   应该   

原文地址:https://www.cnblogs.com/lansan0701/p/8728219.html

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