Benjamin
Benjamin

Reputation: 1

Accidentally Deleted (overwrote) Local Files in Git Repo

I executed the command git checkout -f branchName on my terminal. That made all of the changes to files I have been working on for four days go away, as I have overwritten them.

The worst part is that I didn't save my files anywhere, nor did I commit previous changes. Is there any way out from this situation? Can I restore my lost files and changes?

Upvotes: 0

Views: 2093

Answers (1)

nikitastrike
nikitastrike

Reputation: 111

I have no idea why you didn't push your changes, but you can try this solution. I also recommend using Sourcetree to manage your repo.

The last resort might be trying a file recovery program like Recuva.

Upvotes: 0

Related Questions