Richest in Africa is a very low bar to clear, Libya is still far more developed than your average sub-Saharan African country (and more peaceful than quite a few), and they still have their oil. Libya's actually got one of the lowest homicide rates on the continent.
In ruins, sure, but being in ruins means that there was an actual infrastructure to ruin, which is a bar that much of Sub-Saharan Africa doesn't even clear
I have a vague memory of once seeing Equatorial Guinea listed as the richest country in Africa; and then later taking a quiz on this site where it was not listed in the top 5 or top 10 richest, and commenting on this fact; and now on this quiz they're listed again in the top 3. Either each list is using different ways of measuring or their is inconsistent data somewhere.
They have a low population and a lot of oil, so per capita their GDP is quite high. And some sites list the GDP per capita as PPP - purchasing power parity. Since the vast majority of people in Equatorial Guinea are very poor, their GDP per capita PPP is high - a little money can buy a lot.
I think what it actually was is that while Equatorial Guinea ranks very high in terms of GDP per capita (for Africa), they still rank pretty low in terms of HDI.
I got Seychelles and South Africa then just started guessing legitimately every country in Africa (I checked, the only ones I didn't guess were Somalia, South Sudan, Malawi, Sierra Leone, and Liberia)
The top five seem to be tax haven, tax haven, diamonds, oil, oil. Got to love an economic monoculture... Although Botswana is actually a very interesting case; how Sir Seretse Khama managed to turn it from arguably the poorest, least developed country in Africa to one of the richest, most developed and most stable.
I'm so proud of Botswana. They really know how to use natural resources to build strong economy They also should be a example to other African countries how gov should treat they citizens. Great job!
Botswana is living proof that African countries can be successful. They don't need lots of handouts but they do need low corruption and good education in their civil service. The textbook model of decolonisation done well.