Many hobby stores will have small files with safe edges. They look like this in profile:
View attachment 4916485
The teeth are cut on the file faces, and the rounded edges are smooth. Just the ticket to file the sides of the nut slots without disturbing the bottom. You may not be able to find them thin enough for the G string though.
But now to reveal my secret tool for jobs like this. It's an auto ignition points file.
Nicholson 02375N Tungsten Point File, 5-1/4"
I have found the Nicholson brand to be the best reliable for this application since the safe edge is very smooth. Other brands I have tried are not as safe on the edges and tend to scar the bottom of the nut slot. They are .044" thick, so are good for typical G strings as well. Worth every penny.