FahamLah

Commands

git restore

git restore [--staged] [--source=<commit>] <file>

Risk: Can lose work

What it does

Puts a file back to a saved version.

When to use it

To throw away a change you don't want.

Example

$ git restore index.html

Throw away changes. They are gone!

$ git restore --staged index.html

Take it out of the box. Safe: the change stays.