To create a stash with a specific name, use:
git stash push -m "your-stash-name"
To view a list of all your stashes, including their names:
git stash list
To apply and remove a specific stash by its name, first, find the stash index using git stash list.
Once you have the index (e.g., stash@{2}
), you can pop it:
git stash pop stash@{2}
If you want to apply the stash without removing it, use:
git stash apply stash@{2}
To delete a specific stash by its name:
git stash drop stash@{2}