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
    What is the significance of using –index in the git stash pop – – index command? A. To commit the ... To index the files staged D. To pull the staged changes...
asked Dec 23, 2022 in Technology by JackTerrance
0 votes
    What is Git stash apply? How is it different from Git stash pop?...
asked Nov 4, 2020 in Technology by JackTerrance
0 votes
0 votes
0 votes
    What is the function of ‘git stash apply’?...
asked Nov 2, 2020 in Technology by JackTerrance
0 votes
0 votes
0 votes
    As asked in this question, I also want to know how to resolve a conflicting git stash pop without ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    How can we stash only one of multiple changed files on my branch?...
asked Jan 8, 2021 in Technology by JackTerrance
0 votes
    What is the Git command to move branch pointer to different commit without checkout? A. Git cherrypick B. Git update-ref C. Git reset head...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    git reflog tracks the commits that are made and the commits that are discarded. A. True B. False...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    git reflog –verbose will print extra information on the screen. A. True B. False...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    git bisect is used to identify a commit that has introduced a bug. A. True B. False...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    Which command helps you track the revisions of your revisions in Git? A. Git reflog B. Git logref C. Git track D. Git revision trak...
asked Dec 24, 2022 in Technology by JackTerrance
0 votes
    What does the command git reset –hard HEAD ~3 do? A. Merges the last 3 commits to the master B. Discards ... nothing D. Resets the head to 3 commits before the current commit...
asked Dec 23, 2022 in Technology by JackTerrance
...