DevOps Generators

Reset Helper

All tools

Choose how much to undo and get the matching git reset command with a short warning.

How it works

Four simple steps

1

Pick a mode

Choose soft, mixed or hard.

2

Read the command

Each mode shows the reset for the last commit.

3

Check the warning

Note what happens to staged and unstaged changes.

4

Copy and run

Adjust HEAD~1 if needed, then run it in your repo.

Reset Helper

About Reset Helper

You committed to the wrong branch, or bundled two unrelated changes into one commit, and want to back up a step. The three reset modes do very different things to your files, and choosing the wrong one can throw away work.

Select a mode and the panel shows the command for undoing the last commit plus a one-line explanation. --soft moves HEAD back one commit and keeps your changes staged, ready to recommit. --mixed, the default, also unstages them but leaves the edited files on disk. --hard resets the index and working tree as well, discarding uncommitted changes to tracked files, which is why the page labels it dangerous.

Every command targets HEAD~1. To go back further, change the number (HEAD~3) or use a commit hash. Two habits save trouble: check git status and stash anything uncommitted before a hard reset, and remember that git reflog still lists the commit you reset away, so a mistaken reset of committed work can usually be reversed. If the commit was already pushed and others pulled it, git revert is safer because it does not rewrite shared history.

The helper is static text in the browser. For reshaping several commits instead of dropping one, see the squash and reword cheat sheet, and the Git shortcut aliases include an unstage command.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Usually not. Run git reflog, find the entry from before the reset, and reset back to it. Uncommitted changes that were discarded are another matter, because Git kept no record of them.

Only on a branch nobody else uses, and then you have to force push. On shared branches use git revert, which adds a new commit that undoes the change without rewriting history.

Nothing, in any of the three modes. Files Git has never tracked stay where they are. git clean is the command that removes them, and it deserves the same caution as a hard reset.

View more FAQs

Related tools

View all

Kubernetes Manifest Studio

Generate Deployment, Service, and Ingress YAML with a drift checklist.

Open

K8s Inspector

Summarize Kubernetes YAML kinds, names, and labels.

Open

K8s Resource Diff

Diff two Kubernetes manifests locally.

Open

K8s Manifest Splitter

Split multi-document YAML into one file per resource.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools