gitrecoverdelete-directory

Recover permanently deleted folder - git project


I had checkout a specific branch on git where I was working. Each time I made some changes, I committed and push them using the command:

git push origin HEAD:master

Today, I deleted the project I was working on from my desktop and tried to clone again the repo with the last code.

When I visited my repo I realized that all the work I was pushing using the command above was not committed. Is there a way to find these files or recover permanently deleted files from my desktop?

I tested some tools (e.g. Stellar, Recuva, Disk Drill, Windows File Recovery, imyfone) without success :(


Solution

  • Okay, so it turns out (from a comment of yours) that when you pushed, you got the Updates were rejected message from the server. Well, when the remote told you that the updates were rejected, that was a message saying that the commits you tried to push were not actually pushed from the local repo to remote repo.

    So the local repo was the only place where these commits existed. And since you deleted the local repo, they don't exist at all.