emmmm为什么会有这个教程呢,因为鄙人不才,不知道咋操作的把公司的git仓库上一个项目清空了,慌得一比啊;网上各种查询,好多教程都不好用,皇天不负有心人,最终找到了正确的方法
回退到分支某个版本 git reset --hard XXXXXXX
(要回退的分支版本号,git仓库上是可以看到的)
查看分支当前版本 git rev-parse HEAD
提交回退的版本 git push -f
强制提交后,当前版本后面的提交版本将会删掉!!!
git仓库代码如何回退到分支某个版本
转载请注明出处:猿客栈 » git仓库代码如何回退到分支某个版本
相关推荐
- git pull 出现 Please make sure you have the correct access rights and the repository exists.解决方法
- git pull 报错 fatal: No remote repository specified. Please, specify either a URL or a remote name from which new revisions should be fetched. 解决办法
- git pull 时候提示fatal: Not a git repository (or any of the parent directories): .git 解决办法
- 仓库代码clone到线上服务器
- Elasticsearch linux 自启动