4 ms·
My solution for this is a script that commits all my changes then tags the resulting commit with a basic descriptive name. Something like this: git discard
by ekimekim 4y ago
My solution for this is a script that commits all my changes then tags the resulting commit with a basic descriptive name. Something like this:
git discard bad-idea-didnt-work
Which creates a tag discarded-bad-idea-didnt-work, then resets back to the previous commit.
I can still find and rescue the changes later by looking at my tags.
Others have suggested using the stash for this but I prefer to keep my stash stack free for shorter-term contexts, eg. if I'm halfway through something but need to go checkout another branch briefly.
- skykooler 4y agoWould you mind sharing that script? It sounds useful.