如何将所有内容回滚到之前的提交 [英] How to rollback everything to previous commit
问题描述
最近在一个有多人的项目中,提交如下图所示。标记为红色,你可以看到一个提交的描述/评论'合并?'。
这个提交添加了大量文件并且改变了许多其他文件,并且从未打算发生。
使用 atlassian-sourcetree 我需要做些什么才能将所有内容都回滚到以蓝色突出显示的提交中? (我在屏幕截图中看到了8次提交)。
如果您已将推送提交到上游...
通过单击 右键单击提交并单击 Recently in a project with multiple people, a commit was made as seen in the image below. Marked in red you can see a commit with the description/comment of 'Merge?'. This commit added numerous files and altered numerous others and was never intended to take place. Using atlassian-sourcetree what do I need to do to roll everything back to the commit highlighted in blue? (I am 8 commits behind as seen in the screenshot.) Select the commit you would like to roll back to and reverse the changes by clicking
Right click on the commit and click on 这篇关于如何将所有内容回滚到之前的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! Reverse File
, Reverse Hunk $ c选择您想要回滚并提交更改的提交$ c>或
反向选定行
。在你想要回滚的提交之后,对所有提交完成此操作。
如果您没有将提交上推...
重置当前分支到这个提交
。
If you have pushed the commits upstream...
Reverse File
, Reverse Hunk
or Reverse Selected Lines
. Do this for all the commits after the commit you would like to roll back to also.If you have not pushed the commits upstream...
Reset current branch to this commit
.