I have a few kegs of the same package in /usr/local/Cellar/libfoo like /usr/local/Cellar/libfoo/1.0.1, /usr/local/Cellar/libfoo/HEAD a
/usr/local/Cellar/libfoo
/usr/local/Cellar/libfoo/1.0.1
/usr/local/Cellar/libfoo/HEAD
I asked in #machomebrew and learned that you can switch between versions using brew switch.
$ brew switch libfoo mycopy
to get version mycopy of libfoo.