# Discarding File Changes — Git

Source: https://www.geekswithgeeks.com/en/git/git-restore-checkout

> git restore to throw away uncommitted edits.

## Restore a file

Reverts a file in the working directory back to its last committed state — **destructive**, uncommitted edits are gone.

```bash
git restore config.js
# older equivalent:
git checkout -- config.js
```

## Unstage a file

Moves a file back from staged to unstaged without touching its content.

```bash
git restore --staged config.js
```
