One good method of developing your plot twist is using it as a destination point when planning your story. Take a notebook and map out your entire story, getting to the point where you inevitably run out of steam and aren't sure where to go next. When you do, make a list of all the possible plot resolutions and twists. If one resonates with you, plot 'backwards' from that to the point in the story map where you ran out of steam.
Another good method is to start with the plot twist and work backwards. For example, The "Arabian Nights" story "The Three Apples" finishes with the revelation that the murderer is the investigator's own slave. This not only ties the investigator to the case in an interesting way, but neatly undermines their deductive abilities, implying that for all their skills, they were blind to their slaves' actions until it was too late. This method, when used like this, gives your story a tremendous narrative coherence and added emotional impact.
Build your twist from your character. This is one of the hardest things to do, especially as a lot of the time you may be called upon to 'kill your darlings' and break a character you're fond of for the good of the overall story. This is particularly true of Christopher Priest's "The Prestige" which continually twists by switching the roles of 'hero' and 'villain' between the dueling magicians at the center of the story, Borden and Angier.