There are a number of ways to deal with scratched wooden flooring, and this will depend on the hard wood - (what type of wood it is), the treatment you have on the floor and what is the quality of the wooden floor you have in place.
If the wood is an oily hard wood (mostly dark), this will self repair - natural wood oils will discolour the scratch and the wood will just look weathered.
If the wood is a lighter less oily finish, feed this with bees wax,but make sure you do not leave any excess around the scratch as this will be slippery.
The finish may be varnished/ stained or more likely lacquered. If the finish has a varnish and can be retreated with the same colour, use an artist (small) brush to feed in a layer at a time of varnish. Wait for each coat to dry before re-applying.
If the finish is lacquer, then it is difficult to treat a small area without professional help. Spray lacquers should not be used unless by experienced personnel, as you may end up with a larger more visible patch in your floor. Make sure the floor is thoroughly clean before applying any finsh as dust and dirt will be sealed in.
Sanding back seriously damaged and worn floors should only be completed by experts, as there are numerous problems to encounter, all of which can seriously damage the appearance of your floor. (For example knots in the wood take longer to sand than surrounding wood, uneven pressure will create uneven finishes and when this is re-coated, the smallest blemish will be highly visible).
Final warning not all wood flooring is solid wood, and may be a thin vaneer over a wood pulp based backing -be careful.
The safest, greenest and in my opinion best solution when dealing with wood is to use beeswax to treat the damage, and live with the wear, which in many cases make the floor look lived in.