backport checkout-branch.sh to phase-1 (so we can switch branches)