You're in what git calls "detached HEAD" state.
There's a super-easy way to recover:
git checkout -b newbranch
creates the new branch newbranch
and puts you on it, at the current commit (i.e., nothing changes except that you're now "on" a branch named newbranch
). You can then do whatever you like on the new branch (add more commits, whatever) and then merge it into some other branch, or whatever else you need to do.