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

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.




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

Search: