rebase: use reflog to find common base with upstream

Signed-off-by: John Keeping <john@keeping.me.uk>