Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# You are halfway through a feature when an urgent bug comes in. # Stash your current changes: git stash # Saved working directory and index state WIP on main: abc1234 # Give the stash a descriptive name: git stash save "WIP: add user profile page" # Also stash untracked files: git stash -u # Your working directory is now clean — switch to fix the bug: git switch hotfix/critical-bug # ... fix, commit, and push the bug fix ... git switch main # List all stashes: git stash list # stash@{0}: WIP on main: add user profile page # stash@{1}: On main: experiment with dark mode # Apply the most recent stash (keeps it in the list): git stash apply # Apply and remove from the list: git stash pop # Apply a specific stash: git stash apply stash@{1} # Remove a specific stash: git stash drop stash@{1} # Remove all stashes: git stash clear
Result
Open