Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was taking over a server that had software, that was not in version control.

I created a git repository where I wanted to start versioning, started picking the important non-cache files with individual git add X, but I accidentally added a folder I didn't want.

I quickly typed git reset --hard (as I would do working on the main production app, in some scenarios) and deleted most of the production system...

Thankfully I had a full backup on S3 (a hand-rolled backup tool), but I didn't have software to restore the files.

I turned to my right, where the CEO was sitting, and I said "I just accidentally deleted X, but it'll be back up in 30 minutes."

45 minutes later and after the fastest I've ever thrown something together I had the site restored.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: