How to undo: sudo chown -R username:username on home

I accidentally ran the command:

sudo chown -R username:username *

on home directory (username = mili). Now I often have problems with group permissions when working on projects. Fix that work is to run:

sudo chgrp -R www-data project-name/

on every project. Is there way to fix this permanently other than reinstalling OS?