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
- opensuse-leap 16.0: stgit 2.7.0-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: stgit 2.7.0-bp160.1.1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms