Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Moving my branch back in time

We had our project at a good, solid spot.  Then I made a couple of commit/pushes with things that it turns out we don't want to have, so I want to move the branch back to a previous push and have all the pushes that came after go away permanently.  I tried right-clicking on the spot I wanted and selecting "Reset current branch to this commit" based on some answers I saw online.  Unfortunately this didn't work as it appears that it only moved my current working spot to that commit but says I'm 3 commits behind.  Those 3 commits are the ones I want deleted so that my currently selected commit will be the latest one ("Puzzle 2 for testing").  Is there a way to do this?  See attached screenshot for what happens after I used the Reset command.

repo.PNG

1 answer

0 votes

How about using command line and doing git-reset

It will make your local code and local history be just like it was at that commit. But then if you wanted to push this to someone else who has the new history, it would fail.

git-reset --hard <commit-hash>

or use this to just go to specific commit, and keep your changes after this as uncommitted

git-reset --soft <commit-hash>

 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

3,270 views 19 18
Join discussion

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