I have a branch called ChartFeature
but I accidentally typed git checkout CHartFeature
and ended up with this in powershell/poshgit:
C:\git\Charting [CHartFeature]> git status
On branch CHartFeature
nothing to commit, working tree clean
What happened here? If I look in SourceTree it does not show the branch, but I can (and got myself into trouble) when I committed files to this branch which I never created. (I never typed git checkout -b CHartFeature
but I did need to merge it into ChartFeature
.)
If I list the local branches this erroneous branch does not exist:
C:\git\Charting [CHartFeature]> git branch
ChartFeature
develop
master
What is git doing when I type git checkout CHartFeature
without having created that branch? What happened to the commits I made there?
What's more, is it safe to type git branch -d CHartFeature
? What would happen if I did?