Usually 'literally' means verbatim, non-figuratively, and non-hyperbolically' but sometimes it is used as an intensifier (which is in contradiction to the non-figurative meaning). Standard usage is 'verbatim', informal usage might be the intensifier. Words can have more than one meaning. The 'intensifier' usage has not pushed out the standard 'verbatim' usage so there is no need for a replacement. You just have to account for which of the two usages from context.
I won't go into the possible reasons why this slippage has occurred. It is undeniable that some people use the word in two different contradictory ways and that one way came first. But I will point out that 'literal' is a somewhat formal word. It is talking about words, it is talking about the thing of which it is a part. If you heard the translation of the word in another language, you would have no idea that it was a special word referring to how to interpret other words. But in your own language it says very important self-reflective things. If the exact meaning of that reflection were changed, it would have quite a different implication.
(long diatribe about prescriptivism and descriptivism cut out)
For the case of 'literally' it is supposed to mean 'word for word as stated', as opposed to 'figuratively' which means... 'not literal' any kind of departure from exact literalness. 'Literally' has not switched its mean entirely to its complement 'figuratively'. But sometimes it is used in a non-verbatim way. If for some reason, everyone began using it solely as an intensifier, then we would probably have to find a new word for the old meaning. 'Verbatim' is sort of a sentence adverb, but might do in a pinch. But people who are using 'literally' figuratively are not out numbering those who use it the primary way.
It'd be like people using 12AM for noon instead of 12PM. Noon has been established (by fiat or thought) to be called 12pm. Doing so otherwise might occur, but it is not what anybody who wants to be understood properly does.
Note I: The translation of 'literally' in other languages is also sometimes used... nonstandardly. That is, there is a well-recognized concept of a primary meaning of an utterance, called its translated 'literal' meaning in most (all?) languages, and then often people use that word to mean something slightly different, some kind of intensive. This is established in French, German, and even Chinese, where the term for 'literally' is something like 'by the character'.
Note II: The misuse (prescriptively)/alternate use (descriptive) of 'literally' has been happening for quite a while. Both Dickens and Charlotte Brontë used literally in the intensive manner. Shakespeare made all sorts of ... clears throat ... errors, both for our time (things have changed since then; we just do not follow all the rules he used to and he wouldn't follow our rules either) and for his time. Is he a standard for his time? He was large, he contained multitudes.
Note III: 'Literally' does not now mean 'figuratively'. The complement of a concept is not, or not necessarily, the opposite of a concept. If something is not small, does that make it large? No, it could also be medium sized. The meaning of 'literally' has, for some people, slipped to one very very specific kind of 'figuratively'. It does not encompass all kinds of figures of speech.
Note IV: 'literally' is literally not literal. Given the etymology, 'literal' literally means 'by the letter'. And really, when you say 'literally' non-hyperbolically, you use it word for word not letter by letter. Letter by letter would be ... hyperbolic!
Note V: Of course if you use 'literally' in a hyperbolic manner, it does sound like you're ... not thinking very hard about the words you're using.
Prescriptively, you should use literally to mean non-idiomatically, non-hyperbolically, word-for-word. And to use it as an intensifier is an error.
Descriptively, some people use 'literally' as an intensifier, but this usage is considered non-standard and will look put of place in formal writing.