SVN Revert Trunk, remove a revision as if it never existed?

后端 未结 5 1887
悲哀的现实
悲哀的现实 2021-01-04 05:02

Is it possible in the svn server to remove a revision as if it never existed?

So we have the following revisions:

1004 // Commit of some bogus code t         


        
5条回答
  •  礼貌的吻别
    2021-01-04 05:54

    These accidents hapen, and it's not a problem if SVN keeps them in its history. What is important is to fix the accident. The way to do it is to revert the changes made by this commit. use the following commands:

    svn merge -r [current_version]:[previous_version] [repository_url]
    svn commit -m “Reverting previous commit and going back to revision [previous_version].”
    

    If you're using TortoiseSVN, you could just show the logs, select the commit, and choose "Revert changes from this revision" in the context menu. It will change your working copy to the previous version, and you'll just have to commit.

    I guess other graphical clients have the same option.

提交回复
热议问题