xxxxxxxxxx
$ git stash
Saved working directory and index state WIP on master:
2dfe283 Implement the new login box
HEAD is now at 2dfe283 Implement the new login box
xxxxxxxxxx
# Stash your changes
git stash
# Optionally, you can provide a message to describe your stash
git stash save "Work in progress - feature XYZ"
# List all stashes
git stash list
# Apply a specific stash (by index)
git stash apply stash@{0}
# Drop a specific stash (by index)
git stash drop stash@{0}
# Apply and drop the most recent stash
git stash pop
# Apply and keep the stash (do not remove it)
git stash branch new-feature-branch
xxxxxxxxxx
git stash:
Saved working directory and index state WIP on main: 491e3b27 New Import Files
To check stash list:
git stash list
To get back all previous changes, you have two options to reapply your stash:
git stash pop - Restore back to the saved state, but it deletes the stash from the temporary storage.
git stash apply - Restore back to the saved state and leaves the stash list for possible later reuse.
xxxxxxxxxx
// What is stash changes in git?
// git stash temporarily shelves (or stashes) changes you've made to your working copy
// so you can work on something else, and then come back and re-apply them later on.
git stash