Recover deleted files with git -rm

1

I have a problem, create a repository with git and upload it to Github, then I realized that I had uploaded the entire directory including the key files of the APIs that I used.

Then I made a git -rm of those files and git commit and removed them from the repository.

But of course now I have also disappeared from my local folder, is there any way to recover them in my local directory?

    
asked by Diego 06.12.2017 в 17:23
source

1 answer

1

You have a git log identify the commit where you still had them, copy the commit key and have git checkout clave_del_commit , once this in your folder you will have the files in your folder again, copy them and paste them in a separate place.

Once done, go back to your branch with git checkout nombre_de_tu_rama_principal (usually master)

    
answered by 06.12.2017 / 17:29
source