create new branch from existing branch commit id code example

Example 1: git create branch with specific commit

# Create a new branch from previous commit's hash
git branch develop 04c900c
 
# Push the new branch to remote repository
git push --set-upstream origin develop
 
# Checkout the new branch
git checkout develop

Example 2: commit to a new branch

git checkout -b your-new-branch
git add <files>
git commit -m <message>

First, checkout your new branch. 
Then add all the files you want to commit to staging. 
Lastly, commit all the files you just added. 
You might want to do a git push origin your-new-branch afterward so your changes show up on the remote.

Example 3: create a branch from old commit

git log --author=<name or email> // get user (press enter to find exact one)
git checkout -b justin a9c146a09505837ec03b //create and checkout branch