I keep lots of commented out code in my projects, usually with a dated explanation of why it was commented out. You don't want someone coming by later and trying the same thing that worked most of the time but was foiled by an inobvious edge case
// The following approach (some psuedocode follows) will not work because of xyz.
Though I'd still prefer not to have that. With a VCS + bugtracker that contains info on how the fixes were arrived at, or very verbose commit messages, you don't even need this.
Commit history is very useful for forensics, and I strongly encourage writing useful commit messages, but if you want to say very clearly "Do not try this!", that shouldn't be buried in history, but be clear in the code itself.
That's not to say the best way to do that is just commented-out code, of course.