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

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

How to go back to a certain commit but still keep all changes in the repo?

Hello! I and my team are working on a game and have been making regular commits.

We just realized that we have a big bug in a previous version of the game, a version that we use for exhibitions and so on.

So I want to go back to the commit that this version is based on, fix the bug, build a new game version, and then return to the latest commit and keep working.

What should I do? I get confused by all the different options and what they do.


1 answer

Hello! This will depend on your setup.


Normally whenever you start a new feature, or bug-fix it's advised that you make a new branch for it. Then you'd normally merge that back into the "master" branch when you're done. However, you can also use branches for releases too -- whenever you do a release you should make a new branch from that point so that you can go back and fix things on that branch if needed.


It sounds like you might not have done that (and that's OK!). So here's what I'd recommend you do:

  1. Click the "Branch" button
  2. Click "Specified commit" and hit the "..." button
  3. Hit "Create branch" and make sure the "Checkout New Branch" is checked
  4. Make the needed changes -- commit, push etc
  5. Now you can switch to this branch when needed and make new bug fixes without it changing your main branch.


Suggest an answer

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

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,742 views 4 12
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