Hacker News new | past | comments | ask | show | jobs | submit login

I use restore quite a lot but it kind of terrifies me that it can erase any amount of uncommitted work if I type something wrong. "git restore ." is basically "delete everything that I don't have a backup of".



Add `-p` (`--patch`) and then pick from the diff prompt what parts you want to restore. You can also use this flag with commit.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: