> For the complete documentation index, see [llms.txt](https://raviram.gitbook.io/version-control/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://raviram.gitbook.io/version-control/basic-operations/undo-changes/restore-modified.md).

# Restore (modified)

### Restore (modified)

What if you realize that you don’t want to keep your changes to the file? How can you easily unmodify it — revert it back to what it looked like when you last committed (or initially cloned, or however you got it into your working directory)

#### The below steps shows how a file was modified and then unmodified using the git restore command:

```
git status

On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   hello.txt

no changes added to commit (use "git add" and/or "git commit -a")
```

```bash
git restore .
```

```
git status

On branch master
nothing to commit, working tree clean
```

Note: instead of unmodifying all files, we can select a specific file by giving its name in the above restore command in place of `.`

{% hint style="warning" %}
A reload might be required in the text editor to reflect the changes which Git is doing, but tools like VS Code and IDEs usually refresh it automatically!
{% endhint %}
