Consider the following scenario:
λ tree . (folder) 10:34:52
.
├── delete-file1
├── delete-file2
├── delete-file3
├── keep-file1
└── keep-folder
└── keep-file2
1 directory, 5 files
Where you have to delete everything besides this one file and one folder then run the following command:
find . -type f ! -name "keep-file*" -exec rm -f {} \;
# in case your files don't have common pattern
find . -type f ! -name "keep-file1" ! -path "*/keep-folder/*" -exec rm -f {} \;