What you should have done before modifying is to copy/duplicate the theme used and rename it (= make a custom theme). Say you used the default theme, duplicate it and rename it my_default. You can still do that. Best place a copy elsewhere so you don't accidentally delete it on upgrade. Copy it back later.
If you don't overwrite hte contents of the themes folder completly and just replace the standard themess your custom theme won't be overwritten.
Same with any plugin you may have modified. (You of course should NEVER modify core files.)
Of course if you modified an very old version of the theme it might need an update. Then you have to either update the modified theme or reapply your changes to a new version (and do all above again).
See http://www.zenphoto.org/news/installation-and-upgrading#4 for an explanation of what files to update.