Checkout to the correct branch.