话不多说直接上步骤: git bash直接干到你的code.直接敲命令: git reset --soft HEAD~1搞定 就是这么简单粗暴. 如有顾虑请自行找个案例测试即可. 参考资料 https://gist.github.com/wilsonsilva/c6f870e6423a1c0076224d1f1e468dbb 希望以上内容能够帮助到遇到同样问题的你.如有其它思路可以随时联系我. 转载于:https://www.cnblogs.com/it-dennis/p/10385176.html