-2

I had a colleague that committed work to the trunk folder whilst I continued to work on a branch. Initially we thought the ideas will be used, but later realized that we would rather leave it for later. His last version was 283. I've now created a branch and put the 283 code in there. I did this by creating a branch from version 270 (last good version) and then replaced the files there and committed them. I'm sure that part is all fine now.

But how do I revert the trunk folder back to version 270? I use TortoiseSVN, but when reverting to version 270, it only updates my local copy - the 271-283 versions stays on the repository. How can I remove them from the repository?

Amanda
  • 159
  • 1
  • 3
  • 16
  • *I use TortoiseSVN, but when reverting to version 270, it only updates my local copy - the 271-283 versions stays on the repository.* - did you do `svn commit` after reverting revisions in working copy? – Ivan Jovović May 26 '15 at 06:52
  • This is a basic "how do I revert changes" question, like http://stackoverflow.com/q/13330011/1390430. In particular, see the answer about using TortoiseSVN. – Ben May 27 '15 at 00:34

1 Answers1

1

If you keep the old versions (including the wrong stuff) you can revert the changes in a working copy and commit it back.

svn co project-url
cd project
svn merge -r 283:270 .
svn commit -m "reverting revisions between r270 and r283"

To explain a little on this: the central command is the merge. Before I only put commands to create a new working copy of the project and switch to it.

So, the merge says, that the changes from 283:270 from the current working copy are applied to the current working copy. As 283 is bigger than 270 it means, that the changes are actually removed (applied backwards). After the merge command your working copy should contains the version 270 (and possibly any changes after r283). If changes were done in the meantime, you might have conflicts on the merge, handle them in the usual way.

If the merge was successful and you tested the working copy you can commit back, as the last command does.

Mnementh
  • 50,487
  • 48
  • 148
  • 202