The following won't help with yesterday, but will help with tomorrow.
Log all your hacks, including the following information:- file name
- old code vs. new code
- purpose of the hack
After new install/update you can compare what you did and decide if you wish to do it again.
By all means, keep a copy of the original file and the previous hack.