Compare potential branch names in reflog to local branches

This saves doing the error-prone sha comparison
Handle branch renaming

Fixes #1