Most Civil War generals appeared to believe that raids against the enemy army's rail line of supply would weaken that army and reduce its options. 1864, in particular, was filled by cavalry raids against railroads -- only Lee did not use his cavalry in such raids (perhaps because they were fully occupied defending Virginia railroads from Union raids).
Damage to Confederate railroads was inflicted in three areas -- rolling stock; buildings, water towers and wood lots; and track and bridges.
Non-locomotive rolling stock was easily destroyed by fire, only the iron parts surviving (and they were not in a usable condition). Locomotives would have gages and petcocks destroyed and the cab burned. This level of damage was easily repaired (though the gages were usually not replaced) and the locomotive returned to service. If the raiders knew what they were doing and had time, they could destroy the locomotive by running it head-on into another locomotive or sitting it on a burning bridge so that it would more completely destroy the bridge and drop the locomotive into the river. Damage at this level was not repairable during the war.
Depots, wood lots, water towers, pumps, warehouses, loading platforms, track master houses, etc. were easily destroyed by fire and axe. Water towers and wood lots had to be replaced, but the other structures were rarely repaired during the war because of a lack of lumber and labor and the likelihood that the repaired structures would be destroyed again before the war was over. As the war progressed, replacing water towers became very difficult, water being provided to locomotives by buckets (passed by passengers) from local streams. Wood lots were essential, but hard to refill because of the shortage of labor caused by conscription and the loss of slaves to the raiders.
Track was inefficiently "destroyed" by raiders in a hurry by just breaking the connections at the ends or rails, then turning over the disconnected rails and the sills still attached to them. Repair was very quickly accomplished. More efficient was taking the whole track structure apart, pilling the sills with rails laid across the top of the pile, then burning the sills. The rails would bend and droop when they got hot enough. Repair required replacing the sills from local wood, reheating the rails and straightening them on site. Repairs obviously took longer, but was not difficult (3/4 mile per day being repaired according to one engineer). Lastly, rails could be made useless without re-rolling (something the Confederacy does not seem to have done) by twisting them while they were hot and weak on the burning sills. This required the use of special tongs to grab the ends of the rails and apply the required torque. Sherman used this method in lower Georgia and in South Carolina, requiring repairs to be made by taking track from other roads to replace the destroyed sections. The lack of replacement fish plates, chairs and spikes was not allowed to slow the restoration of service on a line, the repairs being made with whatever could be found that the raiders had left behind and whatever the local railroads might have in stock.
Bridges, trestles and culverts took much longer to repair than the rail. Culverts were usually ignored or blown up with powder. Trestles were easily burned, and reasonably easily repaired with new poles made from local trees. Bridges took time and someone who knew what he was doing. They also required lumber, labor and sometimes iron work (mostly bolts and nuts). To speed repairs, bridges were surveyed and replacement timbers cut and fashioned and stored near a major city.
In the Confederacy, repairs were the responsibility of the railroad companies. Reality, however, soon had the government providing assistance, and, eventually, manpower. A plan to form a railroad repair corps of slaves, mechanics and engineers was never formally enacted, though, in practice, it almost existed in the west in 1864 and 1865.
Even with the lack of material and manpower and without a repair corps, the only really effective raid on Confederate railroads was Sherman's raid from Atlanta to Savannah. This was so effective that some of the roads were not back in operation over their full length until after the war was over. Effectiveness was achieved by using an entire army, not a cavalry force, and destroying dozens of miles of several roads at once, and doing it right by twisting the rails.