Git new branch then roll back to previous version

I have a few different branches including my master branch. I want to create a new branch from master which I think can be done like this correct me if I’m wrong.

git branch masterDup
git checkout masterDup

I then want to roll the masterDup branch back to an old version. Can this be done without effecting the master or any other branches. So only masterDup would be rolled back.
If so how would I roll back using the commit ID just for this newly created branch.

  • git diff renamed/moved and modified files but skip renamed/moved and identical files
  • Git move commits to different branch, and make master same as upstream master branch
  • Why can I see a commit on GitHub but can't look at it on my local repository?
  • After rebasing my github fork, commits from others are in my pull request
  • Git and branches
  • Copy a git repo without history
  • I have the commit ID in the my log history. commit 6f041c1e37bb97aab35678d35c8923fabe33c8d2c

    I’m using terminal for my git commands.

  • Git or Subversion?
  • How to keep different versions of my WSDLs in different git branches of my workflow
  • git-filter-branch to remove strings, but where strings contain $ ' \ and other characters
  • Migrate from LFS to annex
  • Is there a difference between these two ways of moving a branch?
  • iPhone: How to re-create XCode built-in git repository?
  • 2 Solutions collect form web for “Git new branch then roll back to previous version”

    Sure, you check out a new branch with

    git checkout -b masterDup

    and then you reset it to an earlier version

    git reset --hard HEAD~x 

    where x is x versions back (or use the hash if you like)

    edited this answer, see comments.

    Right after the checkout of the new branch

    git reset --hard 6f041c1e37bb97aab35678d35c8923fabe33c8d2c
    Git Baby is a git and github fan, let's start git clone.