Git Stash (original) (raw)

Last Updated : 16 Jan, 2026

Git stash allows you to temporarily save uncommitted changes so you can switch tasks without committing incomplete work or losing progress.

Characteristics of Git Stash

Here are the key characteristics of Git Stash:

Git Stash Commands

Here are the basic and advanced commands we can use with Git stash:

1. Stashing Changes

To stash our current changes, use:

git stash

sc13

git stash

This saves modifications in tracked files and clears the working directory. Untracked and ignored files are not included by default.

**Stashing with a Message: we can add a description to our stash, which is useful if we have multiple stashes:

git stash push -m "Work in progress on feature X"

**Stashing Including Untracked Files: To include untracked files in our stash, use the -u (or --include-untracked) option:

git stash -u

2. Listing Stashes

To see all stashes saved in our repository, use

git stash list

git stash list

3. Applying Stashes

git stash apply

Applying Stashes

git stash apply stash@{1}

git stash pop

git stash pop

This applies the latest stash and removes it from the list.

4. Dropping a Stash

git stash drop stash@{0}

git stash drop

5. Clearing All Stashes

git stash clear

git stash clear

Use with caution, as this action cannot be undone.

6. Creating a Branch from a Stash

git stash branch new-branch-name

git stash branch new-branch-name

Common Use Cases for Git Stash

The below are the common use cases of git stash:

Best Practices for Using Git Stash

Also Check: