I typically save a pristine copy of the distributed code base.... And then make my changes to a copy. With a visual diff tool, it is easy to see where you have made changes and to cross those changes over to a new version of the code when it shows up.