My biggest mistakes have not been in programing per se: a faulty Apple II floppy disk made me loose about 2 weeks of work at crunch time in a project. The lesson I leraned: backup early, backup often!
Later on I learned the hard way that features never go away. If a user asks you to remove a feature, don't throw away the code: chances are that some day they will come back to you, asking you to add it (they will have forgotten that you ever wrote it), with a really tight deadline. The lesson I learned: version control tools are good for you.