简体   繁体   English

如何撤消“ svn up -r <old version> ”

[英]how to undo “svn up -r<old version>”

I wanted to go back and check how things looked at a previous commit, so I used 我想回去查看一下上一次提交时的情况,所以我使用了

svn up -r<number>

As so many posts on this site suggest. 正如该网站上的许多帖子所建议的那样。 But NOW I want to go BACK to what in git-speak is the HEAD, my most recent commit. 但是现在我想回到git-speak中的HEAD,这是我最近的提交。

I checked svn log to get the revision number, but the log only goes up to the old commit I updated to. 我检查了svn日志以获取修订号,但是该日志仅记录到我更新到的旧提交中。

How can I go back to my most recent revision? 我该如何返回到最新版本? I'm a little scared to just 我有点害怕

svn revert

Knowing that that has a tendency to destroy stuff if you're not careful. 如果不小心,那会破坏东西。

A revert will not change the revision of your working copy, it will merely remove any changes that it contains. 还原不会更改您的工作副本的修订版本,只会删除其中包含的所有更改。 Just do an update without arguments: 只需执行不带参数的更新:

svn update

The implicit revision is HEAD when you do not supply a revision number. 当您不提供修订号时,隐式修订为HEAD。 You could do it explicitly as well: 您也可以明确地做到这一点:

svn update -rHEAD

The update command will do its best to preserve your changes, while revert will remove them all. update命令将尽最大努力保留更改,而还原命令将全部删除。

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

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