Minuet in G was not composed by J.S. Bach
Johann Sebastian Bach, Pioneer of Baroque music, father of twenty children, model worker and man of great sentiment. It is no wonder that a keyboard piece found in a notebook was wrongly attributed to him. The score in question is known as "Minuet in G" and is found in a notebook Bach gave to his second wife, Anna Magdalena.
Originally thought to be an original composition by Bach, it has, since 1970, been found to be the work of composer Christian Petzold.
source
Christian Petzold (1677 – 1733) was a German composer and organist. He was active in Dresden, and achieved a high reputation during his lifetime, but his surviving works are but a few. It was established in the 1970s that the famous Minuet in G major, credited to Johann Sebastian Bach, was in fact the work of Petzold.
Bach gave Anna Magdalena two music manuscript notebooks, one in 1722 and the other in 1725. The second one, in addition to being bigger, was also completely embellished in a baroque style, not unlike Bach's music.
Bach did contribute a few musical scores to the 1725 notebook, but the bulk of the material found within it was painstakingly compiled by Anna Magdalena herself. Two sons, Johann Christian and Carl Philipp Emanuel, as well as a handful of close family associates, also assisted to record the scripts.
The 1722 and 1725 compilations serve as a mirror to the style of music that was popular in Germany of that period. It is unknown whether Christian Petzold, a contemporary of Bach, knew the Bach family, or had his work honorably saved in Magdalena's 1725 collection just because it was much appreciated by her family.
Another popular work from the collection is the Musette in D BMV Ahn. 126. While the piece is currently credited as being composed by Johann Sebastian Bach, this has not been accurately proven and the piece’s true authorship still remains unknown.
Despite many of the works being by other composers (and a few anonymous pieces as well), the Notebook for Anna Magdalena does contain a huge number of very famous works by J.S. Bach himself. Like Bach’s Prelude in C major, BWV 846 from the Well-Tempered Clavier (Book 1) is in the Notebook for Anna Magdalena and the very famous aria which starts the Goldberg Variations appears in the collection as aria in G Major, BWV 988/1.