Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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

Atlassian Community Events