SVN version rollback

When we want to abandon the modification of the file, we can use  the SVN revert  command.

The svn revert operation will undo any local changes in any file or directory.

We modify the file readme to check the status of the file.

root@runoob:~/svn/runoob01/trunk# svn status
M       readme

At this time, we found a modification error. To undo the modification, return to the unmodified state through the svn revert file readme.

root@runoob:~/svn/runoob01/trunk# svn revert readme 
Reverted 'readme'

Check the status again.

root@runoob:~/svn/runoob01/trunk# svn status 
root@runoob:~/svn/runoob01/trunk# 

After the revert operation, the readme file is restored to its original state. The revert operation can not only restore a single file to its original state, but also restore the entire directory to its original state. Use the -R command to restore the directory, as follows.

svn revert -R trunk

But what if we want to revert a version that has already been committed.

In order to eliminate an old version, we must undo all changes in the old version and commit a new version. This operation is called reverse merge.

First, find the current version of the warehouse, which is now version 22, and we need to undo the previous version, such as version 21.

svn merge -r 22:21 readme 

Guess you like

Origin blog.csdn.net/qq_21743659/article/details/132270821