有没有办法从意外的“svn revert"中恢复过来? [英] Is there a way to recover from an accidental "svn revert"?
问题描述
今天早上我通过执行以下操作成功地射中了自己的脚:
I managed to shoot myself in the foot this morning by doing the following:
- 开始修改我的项目
- 对一堆文件进行了一系列编辑
- 意识到我的方法全错了,我需要重新开始
- cd 到我项目的顶层并执行了svn --recursive revert".将我的本地沙箱恢复到更改前的状态.
- 当我意识到我的本地沙箱中还有许多其他未完成的更改时,我惊恐地嚎叫起来,而我刚刚抹去了所有这些更改.(上周五 svn 服务器宕机了,所以我无法检查它们,周末我忘记了它们)
幸运的是,在这种情况下,我在周五下班前完成了svn diff > temp.txt",并且 temp.txt 文件仍在我的硬盘上,因此我能够将该文件输入patch"并恢复我丢失的更改.
Fortunately in this case I had done an "svn diff > temp.txt" before leaving work on Friday, and the temp.txt file was still on my hard drive, so I was able to feed that file into "patch" and recover my lost changes.
但是为了我将来的参考(即下次我犯同样愚蠢的错误时)......有没有办法告诉 svn 撤消svn revert"?svn 是否在任何地方保留本地/未签入差异的备份?
But for my future reference (i.e. the next time I make the same dumb mistake)... is there any way to tell svn to undo an "svn revert"? Does svn keep a backup of the local/not-checked-in diffs anywhere?
推荐答案
否,(绝对)否.
如果您对 Subversion 说它应该还原文件,那么所有更改都将随风而去.
If you say to Subversion it should revert a file, all changes are gone by the wind.
只有你的记忆才能把它们找回来.
Only your memory can get them back.
例外:您添加的新文件,只会失去已添加"状态,但文件将保留在此目录中,只有状态未知(?")
Exception: New files you had added, will only lose their status "added", but the file will remain in this directory, only status is unknown("?")
平台/软件异常: 在 Windows 上使用 TortoiseSVN,Revert 首先将文件扔进回收站,然后将它们还原.您可以深入回收站以恢复文件.
Platform / Software exception: Using TortoiseSVN on Windows, Revert first throws the files into Recycle Bin and then reverts them. You can dig into the Recycle Bin to recover the files.
这篇关于有没有办法从意外的“svn revert"中恢复过来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!