git stash

The command that saves your uncommitted changes aside and returns the working tree to the last commit, so you can come back to them later.

In more detail

git stash saves both staged and unstaged changes to tracked files, git stash list shows what is saved, and git stash pop reapplies the newest entry and removes it from the list. Untracked files are left alone unless you add -u.

Examples

git stash
git stash pop

Related terms

Taught in

References