Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Reset branch to different commit (Git)

How can I reset (hard or soft) my current branch to a different commit?

1 answer

git reset --hard COMMIT_ID


git reset --hard 0f347f

With SourceTree you would probably right click on the commit and do a checkout (discard changed) or something

I know how I can do that on command line, but I want to avoid command line at all. BTW, the Reset toolbar button exists, but is disabled.

As Colin says, right-click a commit in the log and select 'Checkout'. You can also use the Checkout toolbar button / menu item and select an item from the list in the dialog.

I've tried, but Checkout just changes what working tree state I will have. It does not move my current branch to the selected commit. Is the Reset feature missing in SourceTree though a toolbar button with this name already exists?

'git reset' has many different modes, SourceTree uses the most common one which is to undo your working copy changes. Checkout effectively does 'git reset' followed by 'git checkout' for missing files.

You're clearly looking for 'git reset --hard' to move your branch pointer elsewhere. SourceTree doesn't support that yet.

Not just reset --hard, but also --soft and --mixed. All those move the branch pointer, but do different things with the index or working tree.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in DevOps

Introducing Atlassian Open DevOps

Hey Community! I’m Shana, a member of our DevOps team here at Atlassian. I wanted to make sure you saw our announcement last week about the launch of Open DevOps since you may have missed it amidst a...

516 views 2 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you