News for hackers. Stuff that matters.
Re:Things I wish everyone knew about Git (Part II) by MBlume on Wednesday July 20, 2022 @02:07AM (#32162041)
"It is really hard to lose stuff"

It is really hard to lose stuff that you have ever committed. It is really hard to lose stuff as long as you commit early and often. Uncommitted work is pretty easy to lose with 'git reset'.

Re:Things I wish everyone knew about Git (Part II) by TheChaplain on Wednesday July 20, 2022 @03:19AM (#32162566)
Depends. I use an IDE from Jetbrains, their "Local History" feature makes it fairly difficult to lose anything, even between changes on uncommitted files.
Re:Things I wish everyone knew about Git (Part II) by stu2b50 on Wednesday July 20, 2022 @10:41AM (#32166412)
I don’t think that counts as a “depends” if it involves the use of another tool.
Re:Things I wish everyone knew about Git (Part II) by atom_arranger on Sunday July 24, 2022 @02:38PM (#32216327)
This has saved me many times. Memory is cheap these days, this should probably be a more common editor feature, on by default.
Re:Things I wish everyone knew about Git (Part II) by perlgeek on Wednesday July 20, 2022 @02:31AM (#32162229)
... or with `git checkout` or with `rm` or `git clean` (for files not yet under version control).
Re:Things I wish everyone knew about Git (Part II) by tsimionescu on Wednesday July 20, 2022 @03:34AM (#32162658)
... or git merge / git pull (but not git rebase) ...
Re:Things I wish everyone knew about Git (Part II) by rjmunro on Wednesday July 20, 2022 @07:48AM (#32164354)
How do you loose files with git merge / git pull?
Re:Things I wish everyone knew about Git (Part II) by witcher01 on Wednesday July 20, 2022 @10:02AM (#32165935)
merge and pull update the reflog just like rebase does, so both can be undone!