How to create a new branch from a specific git commit.

Hi, I'm Satyanarayan Dalei, a mid-level Full-stack web developer from India. Currently pursuing a master's in Computer Application, I've been coding since 2020. My expertise lies in the MERN stack, and I am well-versed in the software deployment life cycle, covering both production and development environments.

Here is my git work that I was working on my next.js portfolio app where I had a need to of creating a branch from a specific git commit. It's supper easy.
Get the commit id. You can use
git logcommand or use git graph VS code extension for that.
write the command like below.
git checkout <---Commit--ID-----> //example git checkout 735f06f9c6a001899e5df5306a7126f337cf9ba3This will take you to that commit point.

Now you are inside of that history point & you can create a branch from this history point.
Create branch use following command
git checkout -b new-branch
Now you have successfully created new branch from a specific git commit

There is also a shorthand command for this
git checkout -b <---new-branch-name--> <---commit-ID--->
//example
git checout -b new-branch 735f06f9c6a001899e5df5306a7126f337cf9ba3
And that’s it! 🎉 You’ve created a new branch from a specific commit!
Happy coding! 😊



