

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Stash
incomplete
2: Pop
incomplete
3: What Is the Stash
incomplete
4: Multiple Stashes
incomplete
5: Unrelated Commit
incomplete
6: Pop Again
incomplete
This lesson's interactive features are locked, please to keep using them
The git stash command stores your changes in a stack (LIFO) data structure. That means that when you retrieve your changes from the stash, you'll always get the most recent changes first.
# 'git stash' pushes a change onto the stash
git stash
# 'git stash pop' pops a change off the stash
# and applies it to the working directory
git stash pop
Click to play video
A "stash" is a collection of changes that you've not yet committed. They might just be "raw" working directory changes, or they might be staged changes. Both can be stashed. So, for example, you can:
When you do, the "stash entry" will contain both the staged and unstaged changes and both your working directory and index will be reverted to the state of the last commit. It's a very convenient way to "pause" your work and come back to it later.