git放弃本地commit,未push

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

步骤:

a) git log:获取commit id;

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

posted @ 2018-04-06 17:14  阑珊0701  阅读(1064)  评论(0编辑  收藏  举报