The git stash command allows you to temporarily shelve (stash) your changes in your working directory, both staged and unstaged, so you can switch context and work on something else. Later, you can reapply these changes to your working copy.
$ git status
On branch main
Changes to be committed:
new file: style.css
Changes not staged for commit:
modified: index.html
$ git stash
Saved working directory and index state WIP on main: 5002d47 our new homepage
HEAD is now at 5002d47 our new homepage
$ git status
On branch main
nothing to commit, working tree clean
$ git stash pop
Reapplies the stashed changes to your working copy and removes the stash.
$ git stash apply
Reapplies the changes to your working copy but retains the stash for future use.
By default, git stash stashes: