I have made several commits in the master branch and then merged them to dev branch.
I want to create a branch from a specific commit in dev branch, which was first comm
You have the arguments in the wrong order:
git branch
and for that, it doesn't matter what branch is checked out; it'll do what you say. (If you omit the commit argument, it defaults to creating a branch at the same place as the current one.)
If you want to check out the new branch as you create it:
git checkout -b
with the same behavior if you omit the commit argument.