How to restore deleted file from Bitbucket.

I am using Sourcetree. One file got deleted from the local folder. I need to restore the file in Bitbucket to my local folder. How do I do it using SourceTree?

TIA

5 answers

1 accepted

Hi Kiran,

In SourceTree just go to the last log line that had that file in it, right click on the file in the file list for the log entry and hit "Reset to Commit..."

Hope that helps

Depends on your situation. You don't say if you have pushed the change or not. Let's say you haven't. Then, you can:

  1. Open Bitbucket's Source tab for your project.
  2. Click on the file you accidentally deleted locally.
    The system displays a view of the file's source code.
  3. Click on the Raw button.
  4. Copy the text.
  5. Open an editor on your local system.
  6. Paste the contents into the a file.
  7. Save the file into your repo.

What you do from there kinda depends on your DVCS. If you need further instructions, let us know whether you are using Mercurial or Git.

Kiran,

Sourcetree is not my forte. I've added that label to your question.

Mary

Thanks for the info. I am using SourceTree and Git. Any way to do this from SourceTree. I was using Tortoise with SVN. In tortoise we can take the log and replace a file from the SVN. Is there anything like that in SourceTree?

Thank you Kieran, this was what I looking. You rocks.

Thanks Mary for the support.

--Kiran

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

25,219 views 26 12
Join discussion

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