STG-RESET(1)

πŸ’… STG-RESET(1) πŸ’…

ok so real quick β€” this is a page from the StGit Manual, and bestie, if you've ever wanted to hit undo on your whole patch stack, this is literally the tool. no cap.


✨ NAME ✨

stg-reset β€” reset the patch stack to an earlier state πŸŽ€


🌸 SYNOPSIS 🌸

stg reset [--hard] [<committish> [<patchname>...]]
stg reset --hard

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the whole vibe here is: you take your patch stack and you rewind it to an earlier state. time travel but make it git, periodt. βͺ

If you don't specify a state at all? Then it just resets the changes in the worktree and nothing else. lowkey the gentlest possible version of this command. 🫢

So how do you actually tell it which state you want? You give it a commit id from the stack log β€” and you can peep that log with stg-log(1) if you need a refresher, iykyk. πŸ“–

And here's the cute part: you can optionally also pass patch name arguments to limit which patches get reset. so instead of nuking the whole stack, you're like "no thanks, just these ones" πŸ’…


πŸ’– OPTIONS πŸ’–

  • --hard β€” discard changes in the index and worktree πŸ”₯
⚠️ bestie be careful β€” this one throws away your index and worktree changes. it's giving no-take-backs. make sure that's actually what you want before you commit to it (pun intended 😭).

πŸ‘‘ STGIT πŸ‘‘

This bad girl is part of the StGit suite β€” see stg(1) for the whole fam. 🌈


that's the whole page, you're welcome πŸ’œ

StGit 2.7.0 Β· 10/17/2026 β€” mwah, go forth and reset responsibly πŸ§šβ€β™€οΈβœ¨

πŸ“¦ where this page comes from