---
name: "stg-undo"
section: "1"
platform: "linux"
package: "stgit"
version: "0.18-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/stg-undo"
---

# stg-undo(1)

Undo the last operation

## NAME

stg-undo - Undo the last operation

## SYNOPSIS

```
stg undo
```

## DESCRIPTION

Reset the patch stack to the previous state. Consecutive invocations of "stg undo" will take you ever further into the past.

## OPTIONS

- \-n N, --number N

  Undo the last N commands.

- \--hard

  Discard changes in your index/worktree.

## STGIT

Part of the StGit suite - see [**stg**(1)](/stg/1.md)
