恢复到文件的先前 SVN 修订版的更好方法? [英] Better way to revert to a previous SVN revision of a file?

查看:25
本文介绍了恢复到文件的先前 SVN 修订版的更好方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不小心向 SVN 存储库提交了太多文件,并更改了一些我无意的内容.(叹气.)为了让它们恢复到以前的状态,我能想到的最好的方法是

I accidentally committed too many files to an SVN repository and changed some things I didn't mean to. (Sigh.) In order to revert them to their prior state, the best I could come up with was

svn rm l3toks.dtx
svn copy -r 854 svn+ssh://<repository URL>/l3toks.dtx ./l3toks.dtx

天啊!没有更好的办法吗?为什么我不能写这样的东西:

Jeez! Is there no better way? Why can't I just write something like this:

svn revert -r 854 l3toks.dtx

好的,我只使用 v1.4.4,但我浏览了 1.5 分支的更改列表,我看不到任何与此直接相关的内容.我错过了什么吗?

Okay, I'm only using v1.4.4, but I skimmed over the changes list for the 1.5 branch and I couldn't see anything directly related to this. Did I miss anything?

我想我还不够清楚.我不认为我想要反向合并,因为那样我会丢失我确实想要进行的更改!假设 fileAfileB 都被修改了,但我只想提交 fileA;不小心打字

I guess I wasn't clear enough. I don't think I want to reverse merge, because then I'll lose the changes that I did want to make! Say that fileA and fileB were both modified but I only wanted to commit fileA; accidentally typing

svn commit -m "small change"

提交两个文件,现在我想回滚fileB.反向合并使这项任务并不比我上面概述的步骤更容易(据我所知).

commits both files, and now I want to roll back fileB. Reverse merging makes this task no easier (as far as I can tell) than the steps I outlined above.

推荐答案

svn merge -r 854:853 l3toks.dtx

svn merge -c -854 l3toks.dtx

这两个命令是等价的.

这篇关于恢复到文件的先前 SVN 修订版的更好方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆