You can run
rpm with the "--setperms" option to restore the original permissions. Doing this for all packages gets a little more complicated, but this should work (please forgive me for not trying this on my system):
Code:
rpm -qa | xargs rpm --setperms
If you've also made ownership changes, you might need to do this again with the "--setugids" option. Note that these will only affect files that were installed with the RPM. Files that were created later by running programs will not be affected.