如何恢复SVN提交?

本文翻译自:How do I revert an SVN commit?

I have found various examples of how to revert an SVN commit like 我找到了各种如何恢复SVN提交的例子

svn merge -r [current_version]:[previous_version] [repository_url]

or 要么

svn merge -c -[R] .

But neither of them seems to work. 但它们似乎都不起作用。 I tried those commands and checked the files that were changed by hand. 我尝试了这些命令并检查了手动更改的文件。

How do I revert a commit with revision number 1944? 如何还原修订号为1944的提交? How do I check that the revert has been done (without looking in the actual file to the changes have been reverted)? 如何检查还原已完成(未查看实际文件中的更改已被还原)?


#1楼

参考:https://stackoom.com/question/TVKb/如何恢复SVN提交


#2楼

svn merge -r 1944:1943 . should revert the changes of r1944 in your working copy. 应该还原工作副本中r1944的更改。 You can then review the changes in your working copy (with diff), but you'd need to commit in order to apply the revert into the repository. 然后,您可以查看工作副本中的更改(使用diff),但是您需要提交才能将还原应用到存储库中。


#3楼

无法“取消提交”修订版本,但您可以将工作副本还原为版本1943并将其作为版本1945提交。版本1943和1945将完全相同,从而有效地还原更改。


#4楼

Both examples must work, but 这两个例子都必须有效,但是

svn merge -r UPREV:LOWREV . undo range 撤消范围

svn merge -c -REV . undo single revision 撤消单个修订

in this syntax - if current dir is WC and (as in must done after every merge) you'll commit results 在这种语法中 - 如果当前目录是WC并且(在每次合并后必须完成),您将提交结果

Do you want to see logs? 你想看日志吗?


#5楼

亚历克斯,试试这个:svn merge [WorkingFolderPath] -r 1944:1943


#6楼

如果您正在使用TortoiseSVN客户端,则可以通过“显示日志”对话框轻松完成。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值