One of my favorite Git tricks is shoveling changes to a Git diff and then applying them later.

I’ll be in the middle of a tricky feature, spike, or bugfix, and need to switch gears. So, I redirect my unstaged changes to a diff:

git diff > fantastic-feature.diff

My global .gitignore ignores *.diff.

Later, when I want those changes, I can usually run:

git apply fantastic-feature.diff

The home directory of my project sometimes contains a dozen or more of these little diffs; things I tried or want to do someday.

Sure, you can use branches for this. I like applying diffs because I don’t have to maintain a branch, or risk pushing something to a remote that I didn’t intend. You can put diffs in Github suggestions, Gists, etc., and you can see them sitting in your directory. I think they’re a bit more lightweight than a branch.