diff --git a/git.md b/git.md new file mode 100755 index 0000000..2dc0a15 --- /dev/null +++ b/git.md @@ -0,0 +1,25 @@ +--- +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 +```