Temporarily save changes that you've made to your working directory but don't want to commit yet.
Stashing lets you save your progress, switch branches to perform another task, then pick up right where you left off. You might use stashing when you need to switch branches in the middle of working on changes, but you aren't ready to make a commit.
Suppose you're working on a feature in a feature branch and you need to switch to the main branch to fix a bug, but you aren't ready to commit your changes.
You can stash your changes, switch branches, fix the bug, then reapply your stashed changes in the feature branch:
Save your changes
Switch to the main branch
Fix the bug
Switch back to your feature branch
Reapply your stashed changes