git 回撤目标版本、覆盖

回撤目标版本

git reset --hard 目标版本号

 

  • 版本反做

git revert -n 版本号

想撤销之前的某一版本,保留该目标版本后面的版本,记录下这整个版本变动流程

 

本地覆盖记录

git commit --amend -m "Add an author/email comment"

线上覆盖提交

git push origin 分支名称:分支名称 -f

原文地址:https://www.cnblogs.com/liuxiaokun/p/12684247.html