美文网首页
Git 如何分支回退代码到历史指定版本(已经提交到远程分支)

Git 如何分支回退代码到历史指定版本(已经提交到远程分支)

作者: 西江月影 | 来源:发表于2019-12-07 13:21 被阅读0次

1. 查提交历史,找到要回退到的版本的commit id

$ git log --pretty=oneline

2. 恢复到历史版本

$ git reset --hard [commit id]

3. 把修改推到远程服务器

$ git push -f -u origin [branch name]

相关文章

网友评论

      本文标题:Git 如何分支回退代码到历史指定版本(已经提交到远程分支)

      本文链接:https://www.haomeiwen.com/subject/iwkugctx.html