I just bought a house from the mid 1800’s. Hardwood throughout but two rooms have had rugs on the floor for obviously many, many, years. When we pulled up the rugs we found that the hardwood was extremely dirty and/or stained. I’m sure there are a hundred different answers as to what to what caused this and the best course of action, hoping to get some ideas for cleaning or if refinishing will be necessary.
You can try cleaning the grime off (thats some of the carpet pad impregnated with dirt), but ultimately you should refinish the wood floor.
This involves a commercial sanding machine and other equipment not readily available.
To clean try and scrape as much of the crud off as possible using a putty knife or a paint scraper. try not to gouge the wood or remove the stain (this is the difficult part). Next you should use some type of floor cleaner. I think a good cleaning product is TSP. It's made for heavy cleaning. Fill a bucket with hot water and mix in the appropriate amount of TSP. Wring the mop out so the floor isn't saturated with water and apply. Scrubbing with a bristle brush will help. Repeat as needed.