In the future the part that was 'pulled out' only needed to be forced left, to manually shut the metering pumps as Denvercaitland called out. OR... simply unplug the connector out of the back of it, which will kill the power to it, allowing the fuel rack to pull closed to its resting position. It is possible that depending on the condition of the metering pumps and the fuel rack, that a little manual assistance might still be required to close the fuel off... but that's the surefire way of making a set stop.
Now as to the solenoid... you may be able to reassemble this (as its an internal magnet assembly, or you may not. You will need to mess around and see if it will go back together). SA-3865 is the part number for this, should it need to be replaced. The OEM Woodward unit is over $200. There are Chicom imports for under $100. Do not misplace the items taken out... the bracket and nut assembly isn't available on the open market.
In an emergency situation, if you can block off the air intake you can stop one of these in their tracks too.