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

git 回退到制定commit

时间:2019-03-13 18:19:58      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:shell   comm   undefined   查看   head   code   origin   clone   ash   


git clone XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

git log -5 // 查看最近5个commit

回退命令:
$ 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

标签:shell   comm   undefined   查看   head   code   origin   clone   ash   

原文地址:https://www.cnblogs.com/liufei1983/p/10524751.html

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