首先查看所有版本
$ git reflog
kza@DESKTOP-EF58Q8I MINGW64 ~/Desktop/sks/my-project (three)
$ git reflog
6388985 (HEAD -> three, origin/three) HEAD@{0}: commit: 测验
07152ba (origin/millyn, origin/kangziao, origin/HEAD, millyn, kangziao) HEAD@{1}: checkout: moving from millyn to three
07152ba (origin/millyn, origin/kangziao, origin/HEAD, millyn, kangziao) HEAD@{2}: merge kangziao: Fast-forward
a51fdd4 HEAD@{3}: checkout: moving from millyn to millyn
a51fdd4 HEAD@{4}: checkout: moving from kangziao to millyn
07152ba (origin/millyn, origin/kangziao, origin/HEAD, millyn, kangziao) HEAD@{5}: commit: 原生框架
a51fdd4 HEAD@{6}: checkout: moving from millyn to kangziao
a51fdd4 HEAD@{7}: clone: from https://git2.wh2.work/kangziao/my-project.git
回退到干净的版本
$ git reset --hard a51fdd4
将之前错误提交的分支覆盖掉
$ git push origin three --force
最后
以上就是飞快红酒最近收集整理的关于git中push错误回退版本的全部内容,更多相关git中push错误回退版本内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复