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

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

Arvid Edström November 29, 2018

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.

Thanks!

1 answer

0 votes
Mike Corsaro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2018

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.

branch.jpg

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events