Want to branch off a moment in time and pretend you never wrote that terrible function That is exactly why Git lets you create a branch from a specific commit. This short guide shows the exact git commands you need and a few survival tips for future you or your teammates in devops.
Creating a branch from a commit is how you explore a historical snapshot without rewriting history. Use it to recover work from an old commit to build a hotfix or to start a fresh feature from a reliable point in version control. It is safe and reversible and it keeps the commit graph honest.
Here are the plain git commands that do the job. No magic, no rewriting of history, no regrets.
Use your favorite log view. The terminal option is compact and reliable.
git log --oneline
Copy the short hash like 1a2b3c4
or the full one if you enjoy being precise.
Make a branch that points at that historical commit.
git branch new-branch 1a2b3c4
If you want to create and switch in one move use git checkout -b with the commit hash.
git checkout -b new-branch 1a2b3c4
If you used git branch then switch with this.
git checkout new-branch
Your working tree and index will reflect the state of that commit so you can develop from that exact snapshot.
Share it with the team when you want others to continue the work.
git push -u origin new-branch
If the commit is very old be explicit in the branch name like hotfix/2025-09-02-repro-fix
or recover/old-feature
That saves time when you are hunting for where a fix came from later.
Remember that creating a branch from a commit does not rewrite history. It simply creates a new pointer. If you need to move history around that is a different set of git-commands that deserve their own tutorial and more coffee.
There you go You now know how to create a branch from a commit with the basic git-commands git-branch git-checkout and git-push This trick is a small but useful tool in any version control toolbox for developers and teams working in devops.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.