The .git folder that I have created into my desktop contains the data of around 64GB so i think to delete that folder to free up some space in my system Now what to do to regain that data again ? Which git command should I use to restore the data ?

I tried to free up the space by deleting the .git folder which contain 64GB of data. But almost whole data of my desktop was deleted .

1

There are 1 best solutions below

0
bahrep On

The .git directory contains all your repository data. I.e., it has all the commits and version history. When you have access to the .git directory, you can restore the working directory (your actual data) using the git restore command. Move the .git directory into e.g. C:\mygit and run git restore C:\mygit.

As noted by @torek, it's unwise to use git as a general backup system. Git is not a backup or cloud file sync software. Don't put the contents of your Desktop directory into version control unless you have a strong need for it.