checkout the index and discard working dir changes