Writing this answer as a more general concept covering options that have or could be used in any number of situations, rather than as a history of what was done on any specific show/movie.
It is important to keep in mind that filming is not typically a linear process. Content filmed may not always be filmed 'in order', actually make it to final edit, and actors who appear in the same scene may not actually have even be on set at the same time as one and other.
It is not unusual to one actor to deliver their lines to 'stand ins'. I've seen actors deliver lines to a volleyball on a light stand in place of the actual actor for the character they were supposed to be talking to, and it isn't unusual that a character who is seen from behind on screen is actually played by a stand in look-alike in place of their real actor.
What is seen "on set" can radically differ from what gets shown on screen after editing.
Writers/Directors/Editors can "Keep them in the dark" with any number of tricks.
- Give actors the wrong context for a scene during filming. ["You're sitting here now doing Y, and X happens latter, but the truth is Z is the actual context..."]
- Write and film multiple lines for the same scene, only using some of it for the final product.
- Redub audio, and/or edit 'out of context' takes into a final version.
- Reuse 'b-roll' creatively to dramatically change the context.
- Film out right 'fakes' with different cast members. [No idea if they actually did it while filming Game of Thrones, but for all I know they could have had every character sit on the Iron Throne to deliver lines as if they won, or even had them deliver multiple lines for it. None would know which version makes it to the final edit.]
Filming for TV or the Movies is not like putting on a play where everyone knows everyone's lines and can see the production from start to end. Actors need to know their lines, but are don't have to be given exact context of what others are saying in an overall scene.
- Consider how some scenes involve a camera change, switching between watching different character's faces, but none of the shots actually include the rest of the cast. If you can only see one character in frame at a time, then other actors might not even have been in the room at the time it was filmed.
- "Pull back shots" showing everyone might not include key dialog. [One project I was involved with had all the actors sitting around a table and basically just making weird frowning faces at each other without saying anything for half an hour to help keep them in the dark as to what the true story line was.]
- In this era of GCI, even a shot with multiple actors clearly visible and delivering lines might be a composite of multiple takes with different people.
- With creative framing/set design (or out right CGI) you can have actors deliver lines while thinking they're in one setting, but appear elsewhere in the final edit.