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

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

SXPCPH November 24, 2016

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

1 vote
Answer accepted
G__Sylvie_Davies__bit-booster_com_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2016

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.
1 vote
Mike Friedrich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 24, 2016

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. 

0 votes
SXPCPH November 25, 2016

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
TAGS
AUG Leaders

Atlassian Community Events