From 09ce26cbde981556280893f173e819fde0596584 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Tue, 27 Jul 2021 21:07:51 +0100 Subject: [PATCH] create notes file on git --- git.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 git.md 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 +```