Prevent reset --hard from deleting everything if one doesn't have any commits yet
- From
- Manuel Guilamo <manuel.guilamo@publicis.com.do>
- Date
- Feb 28, 2019, 21:43 UTC
- Message-ID
- <15568DDA-F501-48C9-A1C0-97C72C29DA23@publicis.com.do>
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.