Use the following to list all the files that would be removed (just to be sure):
filesfind /path/to/directory -mindepth 1 ! -name "*dist"
Add -type f
if you only want to delete regular files, not symbolic links or directories.
Run the command with additional -delete
argument at the end to remove them.