Suggest an editImprove this articleRefine the answer for “What is `git stash`?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**`git stash`** is a mechanism for temporarily saving uncommitted changes in order to clean the working directory and bring those changes back later. **Key point:** changes are not lost and do not become part of the commit history, and a stash is stored locally and not transferred via `push`.Shown above the full answer for quick recall.Answer (EN)Image`git stash` is a mechanism for temporarily saving uncommitted changes to clean the working directory and bring those changes back later. --- ## What `git stash` does The command: ```bash git stash ``` Git: - saves changes from the working directory and staging area into temporary storage - clears the working directory - returns the repository to the state of the last commit Changes are **not lost** and do not become part of the commit history. --- ## Why `git stash` is needed `git stash` is used when you need to: - temporarily switch to another branch - postpone unfinished work - quickly clean the working directory without a commit --- ## Main operations ```bash git stash # save changes git stash list # list saved stashes git stash apply # apply a stash (without removing it) git stash pop # apply and remove a stash git stash drop # remove a stash ``` --- ## What is important to know - a stash is stored **locally** - a stash is not a commit - a stash is not transferred via `push` - multiple stashes can be kept --- ## A key phrasing for an interview > `git stash` lets you temporarily save uncommitted changes and clean the working directory, so you can later bring those changes back without creating a commit.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.