参考的这个博客/qq_37143673/article/details/85258947
目录step1:查看提交记录,获得版本号step2:本地回退到相应的版本step3:远程仓库也退到相应的版本
step1:查看提交记录,获得版本号
git log
commit 36cc122f5a2218d2b2d4109593a4ec5de589f807Author: yhl <>Date: Thu Sep 23 09:51:54 +0800ignorecommit 203738c9ccad7d95b728c8d9d287f2ff24eaaca2Author: chen1234520 <>Date: Wed Sep 22 18:14:18 +0800更新头文件路径commit a9b26683996b88c2bb87cff9cc1bdae38b9c5708Author: chen1234520 <>Date: Wed Sep 22 17:30:07 +0800上传测试样例图
commit后面的一串数字就是版本号
step2:本地回退到相应的版本
git reset --hard <版本号>
git reset --hard 203738c9ccad7d95b728c8d9d287f2ff24eaaca2
step3:远程仓库也退到相应的版本
git push origin <分支名> --force
git push origin master --force