Brans
Brans

Reputation: 649

How to save/restore local changes at SVN

How can I save my all local changes in SVN, revert them, and then restore them later?

Upvotes: 4

Views: 3997

Answers (2)

Álvaro González
Álvaro González

Reputation: 146630

The feature you describe is sometimes called shelving or stashing. Subversion does not offer it.

It's possible to simulate it with patches:

  1. You create a patch
  2. You revert changes
  3. You work on something else and commit
  4. You apply the previously created patch

Some editors like NetBeans can do it for you transparently. There're also third-party scripts.

Optionally, you can create a temporary branch, commit your pending changes there, switch back to previous branch and finally port changes back (svn merge) when you're done.

Aside from raw Subversion, it's possible to have this feature with some of your helper tools. For example, TortoiseSVN has it and so do JetBrains IDEs like PhpStorm. Those are local features so they won't be visible in other Subversion clients, but they can work for you.

Upvotes: 6

JoRouss
JoRouss

Reputation: 2884

When you commit your changes, they are saved to a revision number. Save it to revert to it later.

Here is an answer to explain how to revert to older revisions:

How do I return to an older version of our code in Subversion?

Upvotes: 0

Related Questions