概述
首先查看所有版本
$ 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错误回退版本所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复