Is it possible to restore data from a deleted but backed up commit file?

Greetings!

One of our developers have found out that they have mistakenly deleted a branch last month where we can find the data file in the backups but do not know how to open or import it.

BitBucket stores all the commits in \Atlassian\ApplicationData\BitBucket\shared\data\repositories\x\objects\y as some 38-character hex-value files - but how can you go about getting data out of them?

3 answers

1 accepted

This widget could not be displayed.

Two possibilities:

  1. One of your cloned git repos might not have yet pruned that branch out of the true history, and so you if you know its original 40-character commit-id, might be able to get the branch back by simply typing "git checkout <commitId>" on a developer workstation.
  2. Grab the entire repo from your backup and copy it to a computer (\Atlassian\ApplicationData\BitBucket\shared\data\repositories\x).  Clone it locally, and jump to the deleted branch:

    git clone \path\to\copy\of\x
    cd x
    git checkout branch
- Regards,

Sylvie Davies
Founder and Software Engineer, bit-booster.com

p.s.  I invite you to try my Bitbucket and JIRA add-ons.  Bit-Booster Commit Graph and More (for Bitbucket), and Git Graph for JIRA.
This widget could not be displayed.

Yes,  that should be possible.

Restore the repository from backup to some workstation. Clone it locally, set origin back to the server repo, then push the deleted branch. 

This widget could not be displayed.

Thank you both so far for your suggestions, we will test them next week.

Edit: Backup branch restored successfully, thank you for your help.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,328 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you