git 回退

revert某个文件

  1. git log 找到要回退的版本
  2. git checkout commitID 文件名
  3. git add 文件名
  4. git commit -m "已经回退该文件到指定版本"

回退某次提交

  1. git revert commitID
    该本次提交的所有文件都会受影响,在这之后提交的内容不会丢失,需要手动解决冲突(手动删除某次版本内容),然后git add ,git commit
原文地址:https://www.cnblogs.com/xingrui/p/14039507.html