Long story short, I worked in a small start up company as a developer for 5 years, and by the end of it things went sour. The problem laid mainly with management and the way they were structuring their project - they did not run it in an agile structured way and blamed the developers when anything went wrong. For example sprints and burndown charts were not used for measuring productivity, instead productivity was measured based on subjective opinion which ultimately lead me to getting a disciplinary hearing. I resigned and cut my losses.
I have since moved on and secured a job as a PM at a relatively good company. I am an agile PM, so now have a lot more awareness of what went wrong at the previous company, and do things differently to my ex line manager with a lot more success. My MD is extremely happy with my performance, since I have given the company a strong sense of direction and structure that has improved productivity.
The problem that I have now moving forward is that at some point I may decide to move on and go corporate, and since many corporates ask for 2 references, I am likely to get one really good one and one bad one. After doing some HR, I have seen (from ex employees) that some corporates ask for performance ratings and if the person has been taken to a disciplinary on the reference form.
What is the best thing to do? I would remove my previous company from my CV, but I will then have a 5 year gap.