Revert a svn folder to a previous revision

前端 未结 4 528
我寻月下人不归
我寻月下人不归 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:34

    Why not using svn merge?

    Assuming you want to revert from current HEAD (last committed) version to revision 268:

    cd folder
    svn up
    svn merge -r HEAD:268 .
    

    Then resolve any conflicts manually (there should be nothing if there is no local change) and:

    svn commit -m "- reverted to revision 268"
    

    To revert single change (e.g. made in revision 666):

    cd folder
    svn merge -c -666 .
    

    To revert local changes (not committed yet):

    cd folder
    svn revert -R .
    

提交回复
热议问题