0

I meant to git branch -d reduce-4 to delete a local repo branch. I accidentally entered git checkout -d reduce-4 and it said (HEAD detached at refs/heads/reduce-4).

I used git checkout -d main to switch HEAD back to main, (I would assume). It doesn't appear that anything broke, but is there anything that changed in the background or anything like that, that I need to be aware of or switch?

And what is the process to undo a process in Git?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
  • 5
    Have a look at the documentation: `git help checkout`, in particular the detached head section. You should use a simple `git checkout main` to switch branches (or alternatively `git switch main`). The process for undoing operations depends on what you want to undo. – Jan Wilamowski Aug 23 '21 at 07:40

0 Answers0