git放弃本地commit,未push

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

步骤:

a) git log:获取commit id;

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

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