2.8jtd, as I can just make out the four injector cables immediately to the rear of engine lifting lug.
For personal safety, I most strongly advise against disconnecting or reconnecting the battery positive, when the negative is still attached.
There is a lot of energy stored in a battery, you could get burnt, or start an electrical fire.
I cannot see any reason for the sensor or gauge to fail when the battery was reconnected, as presumably you reconnected with the ignition off. No power to gauge/sensor until ignition on.
Without wiring diagrams for the x230 2.8jtd, fault diagnosis is difficult. The sensor is the most likely cause, but it is a process of elimination. If you wish to try a new sensor, they can be bought on Ebay for about £12. The appropriate sensor has the two electrical blades at right angles. M16 x 1.5mm thread, 22mm spanner size. To get access you would have to remove several air hoses. New clips would be required for some, if not all. If you can get that far without draining the cooling syatem, I would be tempted to swap the connector to the new spare sensor, and earth the body. (It may be possible to hold it in a grounded jump cable.) If sensor is faulty, you will have to consider lowereing the coolant level. The top radiator hose clip would have to be cut off. Better access if LH headlamp is removed.
Sorry to be a Jonah, but you can see the problem.