Because git never checks out a branch just a commit directly you have to do the following:
To get the sha of the checked out commit:
git rev-parse HEAD
To get the all branches that commit is under:
git branch -a --contains SHA
The out put of the second command could look like this
master
remotes/origin/HEAD -> origin/master
remotes/origin/develop