Former Bayern Munich and France winger Franck Ribery has revealed that he almost had his leg amputated towards the end of his career after surgery on his knee.