简体   繁体   English

如何撤消SVN更改..?

[英]How to undo SVN changes..?

I'm finding lots of similar questions, but nothing exactly like this so I'm not sure how to resolve it. 我发现了很多类似的问题,但是没有一个完全像这样的问题,因此我不确定如何解决。

I'm just trying to update the readme.txt file in a tagged version of my WordPress plugin . 我只是想在WordPress插件标记版本中更新readme.txt文件。 I wasn't thinking correctly, and I ran the following commands. 我没有正确思考,因此运行了以下命令。

svn up
svn cp trunk tags/1.1.5

I was thinking it would just take any new/modified files in the trunk directory (which in this case would only be that one file) and copy it into my tagged version directory. 我在想,它只是将主目录中的所有新文件/修改过的文件(在这种情况下,只有一个文件)复制到我标记的版本目录中。 Instead, it copied the entire /trunk directory into my tagged version directory, so when I would run svn stat I would get this. 相反,它将整个/ trunk目录复制到了我标记的版本目录中,所以当我运行svn stat时,我会得到这个。

A + tags\1.1.5\trunk
A + tags\1.1.5\trunk\readme.txt

And when I look at the local directory I can see that new directory was in there, but that's not what I wanted, of course. 当我查看本地目录时,我可以看到那里有新目录,但这当然不是我想要的。

At this point I just deleted that directory back out via my file browser, and now when I run svn stat I end up with a whole bunch lines like this... 此时,我只是通过文件浏览器删除了该目录,现在当我运行svn stat时,我得到了很多这样的提示……

! tags\1.1.5\trunk
! tags\1.1.5\trunk\assets

I have a line like that for every file/directory that was deleted, which makes sense, but now I'm just a little scared to continue. 对于删除的每个文件/目录,我都有这样的一行,这很有意义,但是现在我有点害怕继续。 I really don't know SVN very well, and the only time I ever use it is when I'm updating WP plugins, which really isn't that often. 我真的不太了解SVN,而且我唯一一次使用它是在更新WP插件时,这种情况并不常见。

Anyway, I haven't run svn ci, so the updates weren't pushed to the remote SVN repo yet, but I'd like to get my local stuff back to the way it was before I ever made that original copy mistake. 无论如何,我还没有运行svn ci,所以更新还没有推送到远程SVN存储库中,但是我想让我的本地设备恢复到我犯原始副本错误之前的状态。 I tried svn revert trunk, but that doesn't seem to have done anything at all. 我尝试了svn revert trunk,但这似乎什么都没做。 I also tried svn revert tags\\1.1.5 and that gave me a message Skipped 'tags1.1.5' and doesn't seem to have actually done anything. 我还尝试了svn revert tags \\ 1.1.5,这给了我一条消息:已跳过“ tags1.1.5” ,并且似乎实际上并未执行任何操作。

Any information about how I can simply undo everything I've done here, or what the best procedure is to fix my screw up here would be greatly appreciated. 任何有关如何可以简单地撤消在这里所做的一切,或在此处修复问题的最佳过程的任何信息,将不胜感激。 Thanks! 谢谢!

As far as I understand your post, your mentioned tags- and trunk directories are working copies. 据我了解您的帖子,您提到的tag-和trunk目录是工作副本。 You said you didn't commit it yet. 您说您尚未提交。 So you could delete your complete tags-directory not only tags/1.1.5 using your file browser and then check it out again. 因此,您可以使用文件浏览器删除完整的标签目录,不仅删除标签/1.1.5,然后再次将其检出。

PS: svn information is in version > 1.7 in the root directory of your working copy. PS:svn信息的版本大于1.7,位于工作副本的根目录中。 So deleting 1.1.5 causes svn to tell you it's missing it. 因此,删除1.1.5会导致svn告诉您它丢失了它。

这成功了。

svn revert -R tags

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM