Try to recover from corrupt git checkouts in a better way