The shoebox under Mr. Harun’s counter: git stash saves the tray and the desk as git makes them. What about new prints, with or without -u? The stash@{0}…
Why it matters
A stash saves you when you must switch branches with half-done work. But new files left behind, entries piling up and the difference between pop and apply often lose work or apply it twice.
The key idea
A stash = commits off any branch, in a stack
Common mistakes
Is there only one stash, or do they stack? They stack. Each git stash adds an entry on top: stash@{0} is the newest, stash@{1} the one before. git stash list shows them all, git stash pop stash@{1} takes a given one.
Why does a new file not get stashed? A stash only saves files git tracks. A file never added stays behind; git stash -u (--include-untracked) saves it too.
The difference between stash pop and stash applypop applies and then drops the entry, apply applies and keeps it. When pop clashes, the entry is not dropped: settle it, git add, then git stash drop.
Try it in this playground
Put the desk in the boxgit stash: the desk and the tray go back to HEAD.
Save a new print with -u Without -u, an untracked print stays behind.
Stack two stashesstash@{0} is the newest, out first.
Apply a stash until it clashes The entry stays in the box until you drop it.