I’ve cloned a large, well-maintained repository. By accident I used the -b flag when checking out a different branch. Git says “Switched to a new branch”. Was the pre-existing branch overwritten, is git’s output misleading, or did I make another mistake?
I’ve cloned a large, well-maintained repository. By accident I used the -b flag when
Share
No.
The default branch has been checked out, and a new local branch has been created from its HEAD.
You can see all the branches with:
Simply switch back to the upstream branch of your choice with
Note that if you have work in progress, you need first to go a
git stash, as explained in “Togit checkoutwithout overwriting data“.