Let's say, like me, you accidentally upgraded PostgresQL or PostGIS or something super important and now you need to go back in time and install the previous version.
-
Find the commit of the old version that you want to install by looking through the Formula/ directory in the
homebrew-core
repo: https://github.com/Homebrew/homebrew-core/commits/master/Formula/ (If the above doesn't work, you'll need to clone thehomebrew-core
repo to your machine and rungit log master -- Formula/<formula name>.rb
). -
Unlink the existing (newer) version:
$ brew unlink <formula_name>