How To Stash Changes in Git: A Simple, Practical Guide

When you’re working on code and suddenly need to switch tasks, Git stash is the feature that lets you “put your unfinished work on a shelf” without committing it. You can then come back later, pick it up, and continue where you left off.

This guide explains what Git stash does, how to use it step-by-step, and what changes depending on your setup and workflow.

What Does “Stashing” Changes in Git Mean?

In plain terms, stashing in Git means:

  • You have uncommitted changes in your working directory
  • You’re not ready to commit them yet
  • You need to switch branches, pull updates, or try something else
  • You want to save your work-in-progress temporarily and come back to it later

Git stash:

  • Saves your uncommitted changes (by default, tracked files only)
  • Cleans your working directory (restores it to the last commit)
  • Lets you reapply those saved changes later

Think of it like this:

  • Commit = “This is a permanent, meaningful checkpoint in history.”
  • Stash = “This is a temporary note of what I was doing; I’ll finish it later.”