notes/git.md

26 lines
273 B
Markdown
Raw Normal View History

2021-07-27 20:07:51 +00:00
---
author: Alvie Rahman
date: \today
title: Git notes
---
# Fix detached head
From https://stackoverflow.com/a/10229202 :
## To Delete Changes
```
git checkout main
```
## To Keep Changes
```
git branch temp
git checkout main
git pull . temp
git branch -D temp
```