The error means exactly what it says. You had a running version of Moodle and then changed the Moodle code for that of an older version (or the other way around). The solution is to replace the entire Moodle code base with a newer version. As Ken pointed out, you can find the version number in the database. The code version must be the same or newer.
How you got into this position I assume you must have some idea.
Either reinstall, or better still upgrade/update. If the code you try to reinstall is the same as the original old code, you may not solve the problem.
The best way to handle it is to install from GIT and pull the latest version.