git 回滚到任意版本

Posted 蔚京霖

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git 回滚到任意版本相关的知识,希望对你有一定的参考价值。

git回滚到任意版本

1.先显示提交的log

$ git log -3
commit 4dc08bb8996a6ee02f
Author: Mark <[email protected]>
Date:   Wed Sep 7 08:08:53 2016 +0800

    xxxxx

commit 9cac9ba76574da2167
Author: xxx<[email protected]>
Date:   Tue Sep 6 22:18:59 2016 +0800

    improved the requst

commit e377f60e28c8b84158
Author: xxx<[email protected]>
Date:   Tue Sep 6 14:42:44 2016 +0800

    changed the password from empty to max123

2.回滚到之前指定 版本

git reset --hard e377f60e28c8b84158

 

以上是关于git 回滚到任意版本的主要内容,如果未能解决你的问题,请参考以下文章