Revert a svn folder to a previous revision

前端 未结 4 521
我寻月下人不归
我寻月下人不归 2021-01-31 02:24

To revert a particular folder in SVN to its previous state I currently use the following:

svn rm folder
svn commit -m \'removed folder to revert to previous vers         


        
4条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 02:29

    Why not using 'svn merge'? That's why: "Then resolve any conflicts manually[..]"

    If I know 'folder' at revision 268 contains the consistent data I'd like to go on with, why automatically create a merge with potentially inconsistent data only to manually remove those changes later. It's error prone and defeats the purpose of my configuration management tool.

    I.e. I'd prefer the recipe from the original request with a minor improvement. If you use 'svn export' to get the old revision you don't have to remove .svn files:

    svn rm folder
    svn commit -m 'removed folder to revert to previous version' .
    svn export -r 268 http://pathto/repo/folder
    svn add folder
    svn commit -m 'reverted to the previous version' folder
    

提交回复
热议问题