Shouldn't the reset be done before the checkout? To avoid checkout failing because of uncommitted local changes?