Markets recovered from the mid-day selloff to close almost flat on Wednesday. The BSE Sensex ended at 58,250.26, down 29.22 points. The Nifty was at 17,353.50, down 8.60 points.