Added reset command before checkout.

Need this change to be in both repositories, otherwise the "chicken and egg" problem will be reintroduced.