Search⌘ K
AI Features

Introduction: Git Stash

Discover how to use Git stash to temporarily save your local changes when you need a clean working state. This lesson teaches you to stash your work, handle interruptions, and reapply changes seamlessly, improving your workflow with Git.

We'll cover the following...

In the next few lessons, you will learn a concept that you may end up using a lot!

Often when you are working, you want to return to a pristine state but you don’t want to lose the work you have done so far. Traditionally, with other source control tools, you’ve copied files that have changed locally aside, then updated your repository, and then diffed and re-applied the changed files.

Stash away your changes

Git has a concept of the “stash” to store all local changes ready to re-apply at will. You can get very sophisticated with the stash. But 99% of the time, I use it like this:

	[do some work]
	[get interrupted]
	git stash
	[deal with interruption]
	git stash pop