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

How to restore deleted file from Bitbucket.

kiranvj April 22, 2013

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

7 votes
Answer accepted
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2013

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

2 votes
m
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2013

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.

1 vote
m
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 28, 2013

Kiran,

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

Mary

0 votes
kiranvj April 28, 2013

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

Thanks Mary for the support.

--Kiran

0 votes
kiranvj April 27, 2013

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?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events