I've made a massive mistake and deleted several files directly on my remote repository. I pulled these changes thinking I would only be pulling the still present files, however I lost all the files on my local repository that I had deleted on the remote one. This caused my maven project to break and I couldn't do anything with it anymore. Is there any way to revert my changes?
            Asked
            
        
        
            Active
            
        
            Viewed 267 times
        
    1 Answers
0
            General idea:
If your local files were committed, you can reset everything to before the git pull:
git reset --hard HEAD@{1}
See git reflog to make sure HEAD@{1} is the right commit.
See an example here.
For Eclipse itself, you can go first to the reflog view
Then you can right-click on a past commit, and select "Reset > Hard"
 
    
    
        VonC
        
- 1,262,500
- 529
- 4,410
- 5,250
- 
                    This answer requires the installation of the Git command line to execute a single command that can also be executed via EGit. – howlger Aug 12 '18 at 14:59
- 
                    
- 
                    I realized I completely forgot to mark this as answered. Reflog really helped, thanks so much. – Glanyx Sep 27 '18 at 13:07
 
     
    