How to reset default permissions after the result of running the chown command
There is no standard way to do this. Easiest approach would to to restore the /usr/local hierarchy from your most recent backup (and manually reapply all changes/installs made later).