If you found that your answer is wrong, you really have only two options:
- (preferably) edit post so it contains the correct answer.
- (alternatively) delete the wrong answer. If the answer is accepted, you need to raise a moderator flag to ask that it be deleted.
The only reason to post a new answer is if you have another approach to solve the problem and would like separate votes on both correct answers.
Note that it is considered abusive behavior to delete and post a new answer simply to avoid the downvotes on your original answer. The community will probably flag this if they see you making a habit of it.
There is no need to keep history of how you got to the answer. If the initial approach was something one would immediately try, you may add a sentence to the updated answer along the lines of ".... approach does not work because …". Of course, if your answer is highly upvoted or was accepted, this is a good case to consider providing a longer explanation of why the original, obvious approach did not work.