jayesh shah
jayesh shah

Reputation: 23

svn revert to previous version

One of the programmer in my team deleted a folder from svn accidentally. Instead of reverting to previous version he manually creating the entire directory copied the files in the directory and committed. So we lost the history for folder. How do we get back the history ?

Let me explain by example, don't go by syntax

svn log directory
revision 4
revision 3
revision 2
revision 1
- svn remove directory(delete at head i.e revision 4)
- svn commit
- svn add directory (contains recursive directory structure with all the files of rev 4)
- svn commit
- svn log directory 
revision 1

Boom we lost all the revision history, yes we can get the revision history by svn merge. Now we want to move back to a previous version (revision 2) of that directory. What is the best way to do it?

Upvotes: 1

Views: 1286

Answers (1)

zerkms
zerkms

Reputation: 255155

  1. Delete directory again, commit
  2. Perform svn copy http://server/path/to/dir@NNN dir (where NNN is the revision when the correct directory existed) and commit

Upvotes: 2

Related Questions