Skip to content
OddsockLocal
Local
Source text

The preview shows up here.

ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Type a word, or leave the box empty for every line.
  2. Read the command and the clause after the separator.
  3. Use undo when you want the lines that put something back, including revert.
  4. Copy the command into your own repository. This page does not run it.

What is Git commands?

This is a pocket list, not the git manual. Each line is a command and a clause about what it changes. git status inspects staged, unstaged and untracked paths. git diff is unstaged work. git diff --staged is what will be committed. git restore --staged -- path unstages without throwing away the edit. git revert HEAD undoes the last commit by adding a new commit. git reflog finds earlier positions of HEAD when a reset went too far.

Read more

The box filters lines. stash returns git stash push -u, which stores changes including untracked files, and git stash apply, which reapplies them and leaves the stash in place. undo matches the lines whose text contains that word, including git revert HEAD, because the clause says it undoes the last commit. An empty box shows the whole list. A word that appears nowhere is an error, not an empty page.

The list does not run git. It will not see your repository. Branch names, commit messages and ignore files have their own pages.

Use cases

  • You stashed with untracked files and you want the apply form that does not drop the stash entry.
  • A commit should be undone in public history, so revert is the line, not a reset you cannot see here.
  • You need the difference between git diff and git diff --staged before you review the wrong half of the change.
  • HEAD moved and reflog is the reminder that the previous position is still findable.

The two stash lines

stash

git stash push -u stores changes, including untracked files. git stash apply reapplies them and does not delete the stash.

Why use Oddsock

apply keeps the stash. The list says so, because the command people remember, pop, would drop the entry.

Related tools

Using this tool

git revert HEAD adds a new commit that reverses it. git restore --staged -- path only unstages. git reflog is how you find a HEAD you already moved.