git stash tallentaa tilapäisesti uncommitted-muutoksesi ja palauttaa working directoryn puhtaaksi tilaksi — jotta voit vaihtaa kontekstia (esim. korjata kiireellisen bugin toisella branchilla) ilman että commitoit keskeneräistä työtä, ja voit palauttaa muutokset myöhemmin.
Ongelman jota stash ratkaisee
You're mid-work with uncommitted changes, but need to switch context urgently:
→ switch branches? Git may refuse (uncommitted changes would conflict) or carry
them along messily
→ commit half-done work? No — it's not ready (pollutes history)
→ STASH saves your changes aside, giving you a clean working directory to switch.
