Better way to revert to a previous SVN revision of a file?

前端 未结 9 1116
小鲜肉
小鲜肉 2020-12-04 04:34

I accidentally committed too many files to an SVN repository and changed some things I didn\'t mean to. (Sigh.) In order to revert them to their prior state, the best I coul

9条回答
  •  执笔经年
    2020-12-04 05:27

    If you use the Eclipse IDE with the SVN plugin you can do as follows:

    1. Right-click the files that you want to revert (or the folder they were contained in, if you deleted them by mistake and you want to add them back)
    2. Select "Team > Switch"
    3. Choose the "Revision" radion button, and enter the revision number you'd like to revert to. Click OK
    4. Go to the Synchronize perspective
    5. Select all the files you want to revert
    6. Right-click on the selection and do "Override and Commit..."

    This will revert the files to the revision that you want. Just keep in mind that SVN will see the changes as a new commit. That is, the change gets a new revision number, and there is no link between the old revision and the new one. You should specify in the commit comments that you are reverting those files to a specific revision.

提交回复
热议问题