tags:

views:

26

answers:

2

Is there a way to revert from a particular changeset?

The changes has been committed, as I see from the changeset. Now, I want to revert back the files from before they were committed.

I did svn revert path/to/file but it's not asking for a password or anything. Nothing is happening.

+2  A: 

You can do a "reverse merge" i.e. "apply" all the changes FROM your current revision TO the revision you want to go back to (i.e. undo all the changes FROM the revision you want to go back to TO the current revision).

svn merge -r HEAD:nnnn .

where nnnn is the revision you want to go back to. http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.merge.html

After reviewing the changes, resolving any conflicts etc., use svn commit to push the changes to the repository.

Adrian Smith
Yes thank you zellus, my mistake! I've updated my answer to reflect that.
Adrian Smith
http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo talks in detail about reverting commits.
zellus
It said "cannot replace a directory from within"
Woppi
Solved: svn merge -r1234:4321 path/to/yourfile path/to/theirfile, where 1234 is your revision and 4321 is the revision you want to go back to.
Woppi
+1  A: 

Solved: svn merge -r1234:4321 path/to/yourfile path/to/thefileyouwanttogobackto,

where
1234 is your revision
4321 is the revision you want to go back to.

Woppi