It depends a little on how your files are sorted locally, if you’re able to isolate those files (e.g. if they are in your world folders), then you can upload only those individual worlds. If they’re interspersed throughout the /Data folder, it would be more challenging and you would have to remove the unused content first or move the used content out into other folders.
We don’t offer this specific use case at present, but it is an interesting challenge. I recommend you ask in the #macro-polo channel of the Foundry Discord server for help writing a script that A) finds used assets per world and B) calls FilePicker.upload with those assets, but into the /Data/worlds/worldId folder, and C) changes the path of the file in world to use the new path. Then, you can upload only the specific certain world in question.
There are a couple of possible solutions, but I’m afraid we don’t support importing only used assets at present, and it depends on the layout of the files on your local machine between used/unused.