Cleaning rusty files is more difficult than you might expect because you have to be careful not to destroy the abrasive nature that makes the file useful. As a result, you need to take a bit more care when removing rust from files than you might when dealing with rust on other tools. Fortunately, with some patience, you can clean files so that you are no longer compelled to replace these tools each time they get a little damp and rusty.
Wipe down the file with mineral oil. This will help remove dirt and grime and may remove some of the thicker flakes of rust as well.
Create a cleaning paste. Mix a cup of baking soda (borax will also work) with 1/4 cup of white vinegar. Add hydrogen peroxide one tablespoon at a time until the paste is thin enough to spread but thick enough not to run.
Coat the file with the cleaning paste. The paste will work on the rust while it sits (for 15 to 30 minutes), and you will likely be able to see a rust color working its way through the paste as time passes.
Remove the paste and the rust from the file with cleaning cloths. You will likely remove most of the flakes of rust with the first treatment but not all of the stains. You can retreat the files up to four more times to remove the stains as well as the actual rust.
Wipe down the file with mineral oil. This will help prevent the formation of new rust and remove any residue from the cleaning.