如果不小心在测试代码中写上了用户名和密码,而且已经commit到git中,那么我要怎么把这次commit删除掉,让它在历史中不会出现?
黄舟2017-04-21 10:59:13
:git checkout -- file can discard the modifications in the workspace;
:git reset HEAD file can undo the modifications in the temporary storage area and return it to the workspace state;
:git reset --hard HEAD^ to return to " The status when adding distributed” version;