Git Stash

Learn how to use the git stash command to stash uncommitted changes in this lesson.

We'll cover the following

The git stash command

Often, you will be working on your separate branch and making some changes that you don’t want to commit just yet, but you will be required to switch over to another branch to do something else in between.

You don’t want to get rid of the changes but also don’t want to commit them either. This exact scenario is where you can use the git stash command.

git stash temporarily stores the staged and modified files in a kind of a cache, all the while making the working branch directory clean.

You could either stash all of the uncommitted changes you have made in the branch or stash individual files.

git stash

Get hands-on with 1400+ tech skills courses.