cancel
Showing results for
Did you mean:
See all
See all
Groups
Explore all groups

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?

1 accepted

1 vote

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

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.

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

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

Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "\${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

247 views 0 12

Atlassian User Groups

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

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.