eolas/zk/Reset_to_remote_version.md

17 lines
324 B
Markdown
Raw Normal View History

2023-01-16 14:56:28 +00:00
---
categories:
- DevOps
2023-04-06 14:30:22 +01:00
tags: [git, procedural]
2023-01-16 14:56:28 +00:00
---
# Reset to remote version of a branch
The scenario: your local Git history has become corrupted in some way and you
want a clean history based on the current state of the remote. We will
demonstrate with `main`.
2023-01-16 14:56:28 +00:00
```
git fetch origin
2023-03-17 11:06:12 +00:00
git reset --hard origin/main
2023-01-16 14:56:28 +00:00
```