在不执行新提交的情况下还原 git 提交



是否可以在不执行新提交来还原这些提交的情况下还原 git 提交?

这将在最后创建一个新的提交:

$ git revert --no-commit D
$ git revert --no-commit C
$ git revert --no-commit B
$ git commit -m "the commit message"
git reset --hard HEAD~1

警告:上述命令将永久删除上次提交的文件修改。可能很危险

最新更新