reset: extract reset_head() from rebase