Hacker News new | ask | show | jobs
by mehrdadn 2596 days ago
Probably a feature given how many gazillion meanings they've given to checkout intentionally, but I have no clue. Hopefully it got the point across though ;) and I'm pretty sure it's not the only way to lose info in git...
1 comments

In a near future, hopefully we will have two new commands, git-switch and git-restore. The former is only about switching branches, the latter restoring files. Then you can stay away from the overloaded git-checkout.

See

https://github.com/git/git/blob/pu/Documentation/git-switch....

https://github.com/git/git/blob/pu/Documentation/git-restore...

That's awesome :) though this is just one way to lose files.
Yeah some of those ways are known and there may be a way to recover those lost changes. It's still too early to see if something will materialize.