Prevent reset --hard from deleting everything if one doesn't have any commits yet
- Date: Thu, 28 Feb 2019 17:43:15 -0400
- From: Manuel Guilamo <manuel.guilamo@xxxxxxxxxxxxxxx>
- Subject: Prevent reset --hard from deleting everything if one doesn't have any commits yet
I accidentally executed git reset —hard in a project that doesn’t have any commits yet. git erased everything, everything I’ve worked the past week, I believe this is not a desired behavior, considering I’m not able to undo that action, because git doesn’t have any history whatsoever.