Cleaning Up Your Stash(Git Stash Clear)
To delete any particular stash (For ex:– stash@{1}), use ‘git stash drop stash@{1}’. By default, this command will drop stash@{0} if no argument is provided (git stash drop). To delete all stashes at once, use the ‘git stash clear’ command.
Git | Working with Stash
Pre-requisites: Git
Git allows multiple users to work on the same project simultaneously. Suppose a developer is working on a feature in a branch and he needs to pull changes from some other developer’s branch or if he has to work urgently on some other feature, but the feature he is currently working on is incomplete. In this case, you cannot commit the partial code of the currently working feature. To add this new feature, you have to remove your current changes and store them somewhere else. For this type of situation, Git offers a very useful command known as ‘git stash‘. git stash command saves the previously written code and then returns to the last commit for a fresh start. Now you can add the new feature without disturbing the old one as it is saved locally. After committing to the new feature you can go on with working on the old feature which was incomplete and uncommitted.