Specifically, I'm using bzr, but tips for any VCS are welcome.
Asked
Active
Viewed 83 times
2 Answers
5
I think there are three options.
Use shelving
bzr shelve --all
bzr unshelve
Create a separate branch with the latest
- Create a patch of you changes and revert the changes. Apply patch when you need your changes back.

Chandra Patni
- 17,347
- 10
- 55
- 65
-
2You may want to use `bzr shelve --all` if you don't want to go through usual interactive selection process. – bialix Dec 31 '09 at 07:58
-
Thanks for the comments. I have modified the answer. – Chandra Patni Dec 31 '09 at 08:01
2
Using Git:
git checkout HEAD^ # get the previous version, changing files on disk to match
make # run your project (or whatever command you use)
git checkout master # return to the "master" branch
The above applies if you've already committed whatever current changes you're working on, and want to go back to the previous commit. If you have changes that have not been committed yet, then use the stash:
git stash # save the uncommitted changes away
make # ...
git stash pop # restore your uncommitted changes
You can make and commit other changes in between the stash and the pop; this is Git's solution to the "boss interrupts with an immediate bug fix request" problem.

Greg Hewgill
- 951,095
- 183
- 1,149
- 1,285