Skip to content

Glossary: Command Line and Git

git restore

Also written: git restore --staged, --source

Discards unstaged edits by putting a file back as in the last commit, which can't be undone. With `--staged` it only unstages, and with `--source=hash` it gets an old version.

Where the book teaches it

Related terms

staging areagit revert