It’s played as a massive twist ending for the movie (as Wolverine’s history in the Weapon X program is a massive plot point in the franchise), but as Bryan Singer explained in his recent post, this was a last-minute change that telegraphed Mystique’s arc in the subsequent film.
As you may recall, the moment in question comes during the final moments of X-Men: Days of Future Past when Charles Xavier’s narration closes out the film.
He makes a remark about the future not being set in stone while we see Wolverine rescued from the Potomac River in Washington D.C., at which point it’s revealed that a disguised Mystique was the one who got him out of the water, not the United States government.