git create branch with previous commit 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: git move branch to previous commit
git checkout 1258f0d0aae #detach from master
git branch -f master HEAD #exactly as above
#optionally reattach to master
git checkout master