Do a git add -A from the top of the working copy, take a look at git status and/or git diff --cached to review what you're about to do, then git commit the result.
cd /tmp
git clone /your/local/rep # make a temp copy
cd rep
git rm -r * # delete everything
cp -r /your/local/rep/* . # get only the files you want
git add * # add them again
git status # everything but those copied will be removed
git commit -a -m 'deleting stuff'
cd /your/local/rep
git pull /tmp/rep # now everything else has been removed
Delete the hidden .git folder (that you can locate within your project folder) and again start the process of creating a git repository using git init command.
First of all, Navigate to your Folder using cd ( change directory) command. Then make sure you are in the correct git branch which you want to work by using the command
git branch
If you want to delete the entire files. you can do the same by using
git rm -r .
for deleting a single file,
git rm file1.txt ( file1.txt - file Name )
for delete a folder,
git rm -r foldername
After deleting the files or folders, you should commit it:
If you prefer using GitHub Desktop, you can simply navigate inside the parent directory of your local repository and delete all of the files inside the parent directory. Then, commit and push your changes. Your repository will be cleansed of all files.