[urgent]Asking about restore local repo - sourceTree


I'm suddenly delete the local repo that contain all of my code. Now all of my code is deleted, I do not know where the delete file go or any method that can help me to restore all the code.

Looking forward for all of your answer, it may save my life.

Thanks alot

1 answer

Is your repo pushed anywhere, or has it been cloned by someone else? If so, you should be able to re-clone it from that location.

Did you delete the parent folder that holds your repository, or just all of it's contents? Navigate as close to where the project was as you can in Windows Explorer/Finder, and make sure your OS is set to show hidden folders. If there is a .git folder, then you should still have your repository, and you've just deleted your working copy.

If the .git folder is NOT there, then you'll need to look for a generic method of recovering deleted files (maybe your OS backs up some files automatically? There are also utilities to recover deleted files that work if the data hasn't been overwritten.

Seth foss bro , i have the exact same problem . i am very much new to this source tree , what i did was that i created a repo without naming it and gave the path of My desktop , then i checked the box (unstaged files) , and i did pressed the commit button , and then i deleted the repo and (it said while deleting that files would be removed from disk , i checked that option ), after that all the files and folders of mine which were present at desktop vanished and now there's only folder remaining which you have mentioned is ".git" ,and it is of 8.5GB , and it contains objects . now sir can please tell me all the steps how to recover my files back in my desktop area as they were like before.. i would be very grateful thankue

and i did not also do any remote,push,pull,clone operations

Hi, I'm not sure which IDE you are using but for my situation I using Pycharm for Python development, the way that I gather back my code is that I come to to the IDE ( Pycharm in this case) choose VCS then it was a local history tab where you can check the auto save create by the IDE and then you can choose to load from the particular auto save. If you are not using Pycharm I suggest that you go to Google and search how to to restore history with (Your IDE name).

@ChaudhryAbdullah You should always have a repo inside a dedicate folder. With SourceTree, open the Clone/Add Repo dialog, and choose the "Add Working Copy" tab. Put your desktop in the path. You should be able to checkout whatever branch you had committed to. Let me know if that works.

@seth foss itrien very much everything but no avail , can you please give me your skype id , can you please help me with my problem by using sharing screens options in Skype?

If you can't load the repository, there's nothing I'm going to be able to do.

how to load the repo ?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

966 views 4 2
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