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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,864
Community Members
 
Community Events
176
Community Groups

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

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

0 votes

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

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events