Search code examples
svnmergepatchshelve

In svn, can I revert a change and shelve it for later?


I have some changes commited a few commits back in my svn repository. Let's say HEAD is at r750 and I want to revert r745 without losing r746-r750. Is this possible?

And, can I somehow save r745 and reapply it later (as a new revision)?


Solution

  • Supposing you get a clean backwards merge, you could do this...

    svn merge -r 745:744 <source>
    

    Then when you want to re-apply it, you could forward merge it back in:

    svn merge --ignore-ancestry -r 744:745 <source>
    

    For more info, check out the "Common Use-Cases for Merging."