1. 程式人生 > >git放棄本地commit,未push

git放棄本地commit,未push

_id set HA class log comm git OS --

如果不小心commit了一個不應該commit的修改,但是還沒有push,想撤銷那個commit。

步驟:

a) git log:獲取commit id;

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

git放棄本地commit,未push