git stash drop

Delete the most recent stash entry

This command is useful for cleaning up your stash list by permanently removing the most recent stash entry, helping you keep your workspace organized and free of unnecessary stashed changes.

It operates by targeting the top stash in your stack (usually stash@{0}) and deleting it, so you no longer have access to those stashed changes.

You can specify a particular stash to delete by providing its name, such as git stash drop stash@{2}.

If you want to clear all stashes at once, use git stash clear instead. Both git stash drop and git stash clear are helpful for managing your stash list, especially when you have accumulated many stashed changes over time.

Related commands

Welcome to GitExamples!

Sign in to enable bookmarking, reminders, progress-tracking and more...