FahamLah

Commands

git stash

git stash [push -m <msg>] · git stash pop

Risk: Careful

What it does

Puts your unsaved changes in a drawer, so your folder is clean.

When to use it

When you must switch branches but your work is not ready.

Example

$ git stash

Put my changes away for now.

$ git stash pop

Take the newest stash back out.

$ git stash list

See what is in the drawer.

$ git stash -u

Also put away new, untracked files.

$ git stash drop

Throw one stash away. It is gone!