CmdID

CmdID / Commands

git-reset

Undo commits or unstage changes by resetting the current Git HEAD to the specified state. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Undo commits or unstage changes by resetting the current Git HEAD to the specified state. If a path is passed, it works as "unstage"; if a commit hash or branch is passed, it works as "uncommit".

Unstage everything

git resetIdentify

Unstage specific file(s)

git reset path/to/file1 path/to/file2 ...Identify

Interactively unstage portions of a file

git reset --patch path/to/fileIdentify

Undo the last commit, keeping its changes (and any further uncommitted changes) in the filesystem

git reset HEAD~Identify

Undo the last two commits, adding their changes to the index, i.e. staged for commit

git reset --soft HEAD~2Identify

Discard any uncommitted changes, staged or not (for only unstaged changes, use git checkout)

git reset --hardIdentify

Reset the repository to a given commit, discarding committed, staged, and uncommitted changes since then

git reset --hard commitIdentify