4 ms·
If you have not committed the changes, then Git is simply not aware that you want to keep those changes in the first place. It is like editing a file, and not
by jnurmine 8y ago
If you have not committed the changes, then Git is simply not aware that you want to keep those changes in the first place.
It is like editing a file, and not saving it. Is the editor at fault? Should it autosave the file? Under what name? Under what directory? Or should the editor just do what you tell it to?
For this particular case, git stash might help.
In general (danger: personal opinion), it is good practise to be mindful of dangerous commands and take a deep breath before issuing them, whatever they are. That is what I do after having learnt it the hard way, as I have also messed up stuff with the hard Git reset, dd, rm, chmod, chown, cp, mv, tar, you name it...
So, if you ask me, Git does not have an "objectively bad UI" as some say, it just does what it is told to. (Insert joke about computers being like an Old Testament God.)
- chx 8y agoRead Jef Raskin's Humane Interface. > It is like editing a file, and not saving it. Is the editor at fault? Yes > Should it autosave the file? Yes > Under what name? Under what directory? I don't care, just stash it somewhere so my work doesn't get lost. Notepad++ does it, for example. It doesn't even reveal where does it stash it, but "Noname 1" happily survives even a reboot.