Reputation: 1041
By accident I called "svn import ..." in the wrong directory. Is there a sensible way to undo this mistake?
Googling I didn't find any useful answer, and the closest to my problem I found on stackoverflow was importing the correct data to the wrong place, whereas I imported the wrong data to the correct place.
And: the repository is NOT new, so deleting it is out of question.
It would be a kind of ironic, if I couldn't undo operations in a version control system. So can someone help me? (Thanks!)
EDIT: I got my repository stored in a Berkley Database, i.e., it's in the file system. Looking at the modification date of all files/directories and at the content of the just modified files I was able to work out what to do except for one thing: does anybody know what's the file txn-current is for? I guess it's connected to the transaction handling, but what's the meaning of its content (length is 2 bytes)?
EDIT 2: Thanks for both helpful answers. I accepted Martin's answer as it should provide the proper way of doing it (as I'm under time pressure I just deleted some files as hinted in my first EDIT ignoring the content of txn-current and live fine with until now). But check out the link Wim gave in his comment!
Upvotes: 6
Views: 9663
Reputation: 96596
If there were no other commits since you imported your files, then you can easily delete the last revision using svn dump
.
The following example is taken from this page:
> svnadmin dump -r1:125 myrepo > my.dump
> svnadmin create myrepo
> svnadmin load myrepo < my.dump
Upvotes: 10
Reputation: 11252
You can't undo a commit directly, the only option for this is to do an svnadmin dump
, remove the commit from the dumpfile (either by hand using a text editor, or using svndumpfilter
, and svnadmin load
it again.
If it's not a real problem that the data stays somewhere in the repository as an older revision, you can just svn delete
it and commit something else instead.
Upvotes: 11