Skip to main content

Deleting a stash in Git

Posted in Development and Git

If you’ve applied a stash non-destructively you might eventually want to clear things down to keep your stash list tidy.

Delete the most recent stash

To get rid of the most recent stash in your list:

git stash drop

You won’t get any “Are you sure you want to delete this?” warnings, so be sure you’re happy to lose the changes in that stash.

Delete a specific stash

If you want to keep your most recent stash and get rid of an earlier stash instead, you can check your list of stashes add the stash index to the drop command:

git stash drop stash@{1}

Delete all stashes

If you’re happy to delete all of your stashes at once there’s a command for that. Again, bear in mind there are no warnings, so if you run this command you’re going to lose all of your stashed changes.

git stash clear

Accessibility in your inbox

I send an accessibility-centric newsletter on the last day of every month, containing:

  • A roundup of the articles I’ve posted
  • A hot pick from my archives
  • Some interesting posts from around the web

I don’t collect any data on when, where or if people open the emails I send them. Your email will only be used to send you newsletters and will never be passed on. You can unsubscribe at any time.

More posts

Here are a couple more posts for you to enjoy. If that’s not enough, have a look at the full list.

  1. WWDC 2025 roundup

    Apple’s World Wide Developers Conference (WWDC) opening keynote is one of the big highlights in my calendar. Here are the bits that stood out to me.

  2. Colour alone can be used to convey meaning, and I don’t like it!

    Despite WCAG’s guidance to avoid conveying information with colour alone, there’s a caveat that allows it, and I’m not a happy bunny!