in Git by
What is Git Stash?

1 Answer

0 votes
by

GIT stash captures the current state of the working directory and index and keeps it on the stack for future use. It reverts the uncommitted changes (both staged and unstaged) from your working directory and returns you a clean working tree.

You can work on something else now, and when you come back, you can re-apply these changes. So, if you want to switch from one context to another without losing your current changes, then you can use stashing.

It is helpful in quick context switching, where you are in a mid-way of a code change that you don’t want to commit or undo it right now and you have got something else to work on. The command to use is git stash.

Related questions

0 votes
asked Sep 5, 2020 in Git by SakshiSharma
0 votes
0 votes
0 votes
asked Sep 5, 2020 in Git by SakshiSharma
0 votes
asked Aug 16, 2020 in Git by RShastri
0 votes
0 votes
asked Oct 16, 2019 in Git by rajeshsharma
0 votes
+1 vote
0 votes
asked Apr 18, 2020 by SakshiSharma
+1 vote
asked May 14, 2019 in C Plus Plus by BravoChamp
0 votes
asked Jul 2, 2022 in Git by sharadyadav1986
...