I don't know about "forgotten"... certainly it was unpopular for quite awhile but composers at least always knew of him and his work. Bach was one of the only older composers that Mozart admired, for example.
Well, that's true, the masters didn't forget about Bach even though the public mostly ignored it. Thankfully Mozart, Beethoven and Mendelssohn helped to keep an appreciation of Bach's work alive.