If you do this often, you'll want to build a reverse dictionary:
>>> rev_ref = dict((v,k) for k,v in ref.iteritems())
>>> rev_ref
{'def': 'abc'}
>>> def revmapper(to):
... return rev_ref[to]
If it's rare, and you don't care if it's inefficient, do this:
>>> def revmapper(to):
... for k,v in ref.iteritems():
... if v == to: return k