The midfielder had another year to run on his agreement at MEMS Priestfield Stadium but has elected to join one of the newcomers to the EFL having enjoyed a loan spell at the club earlier in the year.
The 24-year-old, who joined the Gills last summer from Bradford, made 24 appearances during his stint at Priestfield, scoring one goal in a 2-1 home win against Coventry last September.
Following his move to Sincil Bank Knott played a pivotal role in getting the Imps back into league football, and has now penned a deal to extend his stay.
Speaking to Lincoln’s official website he said: "We had a great end to last season and it was only right to come back here and show the fans what I can do.”
Gillingham FC would like to thank Billy for his services while at the club and we wish him well for the future.