How to reset default permissions after the result of running the chown command I ran this line in Terminal:

sudo chown -R $USER /usr/local


Now I want to reverse it to the default permissions. How do I do that?

(I think the default owner is system)
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).