MicrolearnENPTES

Stash: put work aside

Lesson 15 of 24 · Git.Micro

Halfway through something and an urgent fix comes in? git stash puts your unfinished changes aside, leaves the folder clean, and gives them back later.

git stash saves your changes (staged and unstaged) and restores the last commit in your folder.

git stash pop brings the latest stash back and removes it from the list; git stash list shows them all.

New files are left out unless you use git stash -u.

Check yourself

What does git stash pop do?

Brings back the latest stash and removes it from the list

You're halfway through changes to index.html when an urgent typo shows up in contact.html (Contcat). Stash your work, fix the typo, commit it alone as Fix typo, then bring your work back.

Do it in the browser: a real Git tool, a short mission and instant feedback. No install.

Start this lesson — free
← Pick a side: --ours and --theirsTags for releases →

All lessons · Git.Micro