Power It Down
The first thing to do whenever an electronic device is exposed to water is to immediately power it down and set it somewhere to dry. For desktop computers, completely isolate your computer’s circuitry by shutting off the power switch from the back. Even though the computer may seem to be operating normally after it has had water on it, it may just be that the water has not yet worked its way into a dangerous area where it can cause a short. That said, moving the computer around can make the water to shift and cause more harm to the system. If possible, towel off any water outside of the machine before it can get in but take care not to move the machine itself. Let it sit still and airs dry it with a fan for at least an hour, but preferably overnight.
Once the majority of the computer has had time to dry, a blow drier on a low setting can help ensure that the device is completely dry.
Test The Hard Drive
The safest way to recover data from your hard drive is to immediately remove the drive and take it to a specialist. They can analyses the drive and ensure that it hasn’t shorted, which protects your equipment and the data that potentially survived any damage the hard drive received. If that option isn’t available, the next best alternative is to hook the drive up to an old computer that hasn’t had any potential shorts, as damage to other equipment in the device can easily destroy your hard drive when next you power it up. If the drive passes the power-on-startup-test, it may not have suffered harm at all and it may be possible to copy any critical data onto a flash drive or in the best case continue to use the drive. If the drive fails POST, then there is little that can be done besides taking the drive to a hardware recovery specialist.
Water is a serious hazard to computers and hard drives especially, but real world circumstances can make this mix in unintended ways. The best solution is first to protect your hardware from shorts, and then recover the data as best with a specialist.