3 ms·
I would recommend never using git checkout to clear local changes, and instead recommend either git stash or git stash -p depending on whether you want to save
by eslaught 8y ago
I would recommend never using git checkout to clear local changes, and instead recommend either git stash or git stash -p depending on whether you want to save the whole work tree or just part of it. The stash subcommand internally creates commits for the stashed content, so you can probably also get to them via the reflog, though I haven't personally needed to do this.
- deleted 8y ago[deleted]
- RichardCA 8y agoIf I have local "dirty" state that I need to hold on to, I just hide it in a temp directory like this: mkdir temp echo '*' >temp/.gitignore Quick, dirty, effective. :)