The instructions below apply to older versions of Homebrew which still provide switch
capability.
For current Homebrew, you'll likely need to keep Versions around, and build locally. Here's my versions repository https://github.com/rdump/homebrew-versions
MacPorts is now keeping versioned installations available as well, by default.