Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deleted files accidentally in SourceTree, need help to recover

So I was trying to learn how to use SourceTree and then I got to a point where I had 2 repositories (with different names) for the same project, so I decided to delete one of those repositories to get a cleaner interface. Then it deleted the whole project from my computer, is it possible to recover the files?

By the way, I was trying to "upload" the project to a repository on BitBucket, but I was unable to do so, the project isn't stored anywhere else.

like image 908
Freguglia Avatar asked Sep 11 '25 21:09

Freguglia


1 Answers

If the files were inside a git repo and the repository still exists you can recover them by doing a checkout on a previous commit when the files existed.

In source tree you can simply double click a previous commit, presuming you still have the repo on disk.

like image 63
adrianvlupu Avatar answered Sep 14 '25 11:09

adrianvlupu