18 lines
345 B
Markdown
18 lines
345 B
Markdown
---
|
|
title: Discard uncommitted changes
|
|
tags: branch,intermediate
|
|
---
|
|
|
|
Discards all uncommitted changes to the current branch.
|
|
|
|
- Use `git reset --hard HEAD` to reset the local directory to match the latest commit and discard all unstaged changes.
|
|
|
|
```sh
|
|
git reset --hard HEAD
|
|
```
|
|
|
|
```sh
|
|
git reset --hard HEAD
|
|
# Discards all unstaged changes
|
|
```
|