Git(TortoiseGit) - 如何将单个文件恢复到之前的修订版本,然后撤消恢复? [英] Git (TortoiseGit) - How to revert a single file to a previous revision and then undo the revert?
问题描述
TortoiseGit在显示日志对话框中提供了回复功能,允许跳回到特定的修订版本,但这将恢复您的整个存储库,而不是一个单一的文件。
同样,一旦我恢复了某些东西,我不知道如何撤消恢复和跳转返回到最新版本。
在TortoiseGit中,答案是右键单击项目文件夹并单击Show Log,然后右键点击您要回滚的更改,然后点击切换/签出到此...。它会让你从提交堆栈中的奇怪位置开始,或者在你计划提交并希望事物保持健全的情况下分支。
When using Git with TortoiseGit: Does somebody know how to revert a single file(or a complete repository) to a previous revision?
For example I have a repository containing multiple files. One file exists in three revisions (1 ; 2 ; 3). Now I want to change from revision 3 back to 2.
TortoiseGit offers a "Revert" function in the "Show log" dialog which allows to jump back to a specific revision, but this will revert your whole repository instead of a single file.
Also once I have reverted something, I don't have a clue how to undo the revert and jump back to the newest revision.
In TortoiseGit the answer is to right-click the project folder and click Show Log, then right-click the change you want to roll back to and click Switch/Checkout to this... . It will let you then proceed from that weird place in the commit stack, or branch in case you plan to commit and want things to stay sane.
这篇关于Git(TortoiseGit) - 如何将单个文件恢复到之前的修订版本,然后撤消恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!