The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to restore cloud repo before a "git push -f origin dev" ?

Priteesh Kissoondhery
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 14, 2022

Our main development branch is called "dev" in this scenario.
Accidentally did a "git push -f origin dev" which pushed my outdated local dev branch to shared repo.

can't seem to find the hash for this change using git log to reflog.

How can I restore the repo ?


1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 15, 2022

Hi @Priteesh Kissoondhery,

I would suggest the following:

1. First, check the following documentation:

Please check all the steps there, including the sections titled

  • "If you don't know the 'sha' off the top of your head, you can:"
  • "If your commits are not in your reflog:"

See if you can recover the branch with any of the methods described there.

 

2. If the above is not possible: are there any other users with access to this repository?

If so, I would suggest asking them if anyone has the previous version (the one before your force push) of the dev branch in their local clone. If so, they can force push it to the repo.

 

3. In case neither step 1 nor step 2 work for you, we may be able to recover a backup of the repo for you prior to the force push.

Please note that this is only possible if the force push was made during the last 7 days; we are not able to recover any content older than 7 days.

If neither step 1 nor step 2 work for you, and the force push was made during the last 7 days, then:

  • You can create a ticket with the support team to ask for a backup of the repo prior to the force push (let them know when you made the force push, so they provide you with the most recent backup prior to the force push).

    If the repo is owned by a workspace on a paid billing plan, you can create a support ticket via https://support.atlassian.com/contact/, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. In the question "What is the impact to your business?" please make sure to select "Level 1".

  • If the repo is owned by a workspace on the free plan, you won't be able to create a support ticket yourself. Please feel free to let me know and I can create the support ticket for you.

Kind regards,
Theodora

TAGS
AUG Leaders

Atlassian Community Events