we might do some mistakes in code .or we have some bugs in our code and if we need to delete some extra unnecessary files, we can remove these files from the working tree, this stops tracking changes for that file.we should use git -rm command. this command will only delete a specific file in the current directory .we can restore the deleted file from the previous history of our repo.
Command to delete a single file
Command to delete the entire directory
Command to delete a file with force
above commands deleted the file both in the filesystem and the index, to delete files only in the repository, use the below command
Command to delete same extension files
The user might need to delete the same set of files like registry files or any specific language files, use below command to the deleted same type of extension files