1、查看log,复制上一版本的commit号
git log
2、重置本地仓库
git reset --soft <commit id>
3、推送回退的代码到远程仓库
git push -f
本文介绍了如何查看git日志获取上一版本的commit号,并通过git reset --soft命令将本地仓库重置到指定commit,最后使用git push -f强制推送回退的代码到远程仓库。
1、查看log,复制上一版本的commit号
git log
2、重置本地仓库
git reset --soft <commit id>
3、推送回退的代码到远程仓库
git push -f
1万+
5680

被折叠的 条评论
为什么被折叠?