我有一个名为 message parent 的 repo。
最初这个 repo 的版本是 1.1.0 。然后它升级到 1.2.0 并进行了一些更改。现在,我们在此版本之上推送了更多更改。出于某种原因,必须还原版本从 1.1.0 更改为 1.2.0 并进行一些更改的提交。是否可以恢复该提交,但仍保留我们在此之上推送的最新更改?两个提交中没有冲突的文件
最佳答案
是的,您可以: TortoiseGit -> Show Log
,然后选择此提交,按右键并从上下文菜单中选择: Revert Change by this commit
。
将创建新提交,还原此提交,所有其他提交保持不变。
来自 Atlassian git revert :
The git revert command undoes a committed snapshot. But, instead of removing the commit from the project history, it figures out how to undo the changes introduced by the commit and appends a new commit with the resulting content. This prevents Git from losing history, which is important for the integrity of your revision history and for reliable collaboration.
关于git - 如何使用 TortoiseGit 还原特定提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46690334/