Remove package's dependencies (does not remove package):
brew deps [FORMULA] | xargs brew remove --ignore-dependencies
Remove package:
brew remove [FORMULA]
Reinstall missing libraries:
brew missing | cut -d: -f2 | sort | uniq | xargs brew install
Hey, so depending on the FORMULA that you're uninstalling this command can be quite dangerous
If the formula has a lot of dependencies that are required for other packages, stuff get broken :(