Github 回退到指定 commit

进入 Git 项目中

$ cd xxx

查看 commit 版本号

$ git log

日志如下

commit 3405b***
Author: 厦门蜂翔 <[email protected]>
Date:   Tue Mar 3 09:00:10 2020 +0800

    准备上线前提交,正式版记得打 tag

commit fda2d2cbca81e5bd449adc19446e7691478edcad
Author: 厦门蜂翔 <[email protected]>
Date:   Mon Mar 2 23:50:35 2020 +0800

    修改xxx

本地回退

$ git reset --hard commit_id ( commit 字符,例 3405b*** )

与远程库同步

$ git push origin HEAD --force

你可能感兴趣的:(Github 回退到指定 commit)