One - One Code All

Blog Content

Git 回滚代码到某个提交 commit

Linux-Mac   2020-07-20 21:33:26

$ git reset --hard HEAD^ 回退到上个版本

$ git reset --hard HEAD~3 回退到前3次提交之前,以此类推,回退到n次提交之前

$ git reset --hard commit_id 退到/进到 指定commit的sha码


强推到远程:

$ git push origin HEAD --force



上一篇:pandas的to_sql的坑if_exists=append
下一篇:k8s将pod运行到指定的节点上,给节点打标签

The minute you think of giving up, think of the reason why you held on so long.