Skip to content

Stash

git stash temporarily shelves changes in your working directory and index, restoring your repository to a clean state (matching HEAD). It is a stack-based mechanism — you can push multiple stashes and pop them in LIFO order.

  • Switching branches with uncommitted work you cannot commit yet.
  • Pulling remote changes that conflict with your local work.
  • Running a quick test on a clean working directory.
  • Context-switching between tasks.