使用git命令取消已经commit且没有push的代码(无删代码)。

git reset --soft HEAD^