码迷,mamicode.com
首页 > 其他好文 > 详细

Git回滚到指定的commit

时间:2018-02-02 16:08:53      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:mit   min   fine   efi   undefined   pos   har   指定   gpo   

查看历史commint
$ git log         (可以记下sha码)

回退命令:

$ git reset --hard HEAD^ 回退到上个版本
$ git reset --hard HEAD~3 回退到前3次提交之前,以此类推,回退到n次提交之前 $ git reset --hard commit_id 退到/进到 指定commit的sha码 (一般都用这个)


强推到远程:

$ git push origin HEAD --force

Git回滚到指定的commit

标签:mit   min   fine   efi   undefined   pos   har   指定   gpo   

原文地址:https://www.cnblogs.com/lanshengzhong/p/8405561.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!