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
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

422 views 5 9
Read article

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