<p>How do I revert a modified file to its previous revision at a specific commit hash (which I determined via <a href="https://git-scm.com/docs/git-log" rel="noreferrer"><code>git log</code></a> and <a href="https://git-scm.com/docs/git-diff" rel="noreferrer"><code>git diff</code></a>)?</p>

```
```
git checkout -- foo
```
```
That will reset
```
foo
```
to HEAD. You can also:
```
```
git checkout HEAD^ foo
```
```
for one revision back, etc.