在代码未提交到远程分支的时候,如果想撤回commit,可以用git reset --soft 操作
1、查看日志
git log
2、提交想对应的id,一般是第一个
git reset --soft commit_id 或者 git reset --soft HEAD^/HEAD~1