Add Reflog support

This PR adds support for the reflog.