Suppose you are implementing a new feature for your product. Your code is in progress and suddenly a customer escalation comes. Because of this, you have to keep aside your new feature work for a few hours. You cannot commit your partial code and also cannot throw away your changes. So you need some temporary space, where you can store your partial changes and later on commit it.
Git Stash Operation - Learn Git (A Fast and Flexible Version Control Tool) in simple and easy steps starting from basic to advanced concepts with examples including installation, project creation, file addition, committing, status checking, tagging project, merging files, branching projects, debugging project, sharing project, administrating project and comparing projects. Accelebrate's Git for Developers training course teaches mobile, desktop and web developers to use Git, the leading software version control system. Git is distributed, free, and appropriate for development projects in almost any language.
In Git, the stash operation takes your modified tracked files, stages changes, and saves them on a stack of unfinished changes that you can reapply at any time.
![Stash Stash](https://inside.runroom.com/app/uploads/2018/05/git-stash-command-1024x533.jpg)
Now, you want to switch branches for customer escalation, but you don’t want to commit what you’ve been working on yet; so you’ll stash the changes. To push a new stash onto your stack, run the git stash command.
Now, your working directory is clean and all the changes are saved on a stack. Let us verify it with the git status command.
![Git Git](/uploads/1/2/5/8/125852023/895365145.png)
Now you can safely switch the branch and work elsewhere. We can view a list of stashed changes by using the git stash list command.
Suppose you have resolved the customer escalation and you are back on your new feature looking for your half-done code, just execute the git stash pop command, to remove the changes from the stack and place them in the current working directory.
The above command will produce the following result: