Home / Community / Blog / Reverting single file in SVN to a particular revision

Reverting single file in SVN to a particular revision

I've accidentally commit corrupted file (long story... ;-) into subversion repository, so I would like to revert to a previous version - but only this one particular file.

My file (l6208.lib) had been corrupted in version 309 (revision 308 was the last good one), so I type:

svn merge -c -309 l6208.lib

please note minus sign before 309. This mean apply differences between 309 and 308. You can also type:

svn merge -c -r 309:308 l6208.lib

Now it's time to commit recovered file.

svn ci l6208.lib -m "Reverted last revision"

I don't know if it is best method, but it works for me.

Comments

Log in or create a user account to comment.

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31