The easy way to repair sand- and rub-throughs on sharp edges is with a marker of a similar color to that of the stain used. These markers are widely available.
If you sand through an edge between coats of finish, simply color in the sand-throughs and apply another coat of finish, to keep the marker color from being rubbed off.
If you rub through an edge on already finished furniture, woodwork or cabinets, it will be more difficult to apply a protective finish after replacing the color. The easiest methods would be to wipe just the edge with wiping varnish, which is thinned oil-based varnish or polyurethane, or with water-based finish. Neither will remove the marker color.