Stashing in GIT

While working in git we sometimes makes some changes in the working directory but don’t want to commit those changes.Suppose you are implementing some new feature.Now you are required to change to a different branch.If you change the branch without committing then all your changes in the existing directory will be lost.Also you don’t want to commit the changes yet as the feature on which you are working is not yet complete.

One of the solutions to the above problem is to stash the changes in the working directory.stashing means to save the state of the working directory.So if you stash the change in the working directory then you can apply the stashed changes later on.

Following are the steps to stash the working directory changes

1.Stash the working directory changes

The above command will do the following:

  • save your uncommitted working directory changes
  • reverts the working directory to the original state

you can view all the stashed changes using the following command

the changes you stashed last should be in the list

2.Reapply the stashed changes

To apply the stashed changes you just execute the following command:


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *