Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Roll back a file in Bitbucket itself?

Options
  • 13-07-2016 11:18am
    #1
    Registered Users Posts: 81,223 ✭✭✭✭


    So I have a dev making a file change and then a commit.
    This file change wasn't good and I want to roll back to previous file version.

    Now, I'd rather do this in BB if possible without having to pull code down and editing file to look like before.
    The reason is that in certain cases a rollback is better than a new file edit.

    Can I roll back in BB itself?


Comments

  • Registered Users Posts: 403 ✭✭counterpointaud


    biko wrote: »
    So I have a dev making a file change and then a commit.
    This file change wasn't good and I want to roll back to previous file version.

    Now, I'd rather do this in BB if possible without having to pull code down and editing file to look like before.
    The reason is that in certain cases a rollback is better than a new file edit.

    Can I roll back in BB itself?

    No, I don't think so.
    Pull down the latest code, and either use git reset, git revert, or git checkout.

    https://git-scm.com/docs/git-revert
    Note: git revert is used to record some new commits to reverse the effect of some earlier commits (often only a faulty one). If you want to throw away all uncommitted changes in your working directory, you should see git-reset[1], particularly the --hard option. If you want to extract specific files as they were in another commit, you should see git-checkout[1], specifically the git checkout <commit> -- <filename> syntax.


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    If you are just reverting to an older commit which you have locally, you can use git push origin <oldcommitid>:branchname.

    Don't do this lightly though!


  • Registered Users Posts: 81,223 ✭✭✭✭biko


    Thanks all, I finally gave up, pulled down in Eclipse and made the edit myself.
    Even in Eclipse I couldn't find an easy way to revert to a previous version. Nuts..


  • Registered Users Posts: 11,977 ✭✭✭✭Giblet


    You really need to use the command line to utilize the full power of git.


  • Registered Users Posts: 403 ✭✭counterpointaud


    Giblet wrote: »
    You really need to use the command line to utilize the full power of git.

    I agree with this. Having said that, here is another option http://www.eclipse.org/egit/


  • Advertisement
Advertisement