Recently I was making some workstation set up shell scripts for our macs at work. Of course these scripts never work the first time around so I needed to find a way to reset the system. Doing a complete reinstall was over the top but clearing out all of the packages already installed was close enough.
This is what I found online somewhere (probably Stack Exchange) which does the job:
brew remove –force $(brew list –formula)
That command doesn’t always clear out all the data files though. MySQL is a perfect example. So don’t forget to delete them yourself.