If you're looking to branch out from a specific commit of a branch, first be sure you are in the branch,
git checkout dev
Now I want to checkout a specific commit 123654 from the dev branch to a new branch while keeping the head on main branch.
git checkout -b new-branch 123654