I'm gonna assume you have two versions of your website from one URL and the desktop version has been hacked.
Check your .htaccess file and look for lines that detect for mobile devices. If they are present, then there will be redirection going on if the device in question isn't of the correct type.
Code to look for can be found by selecting any of the applicable blue buttons at:
Here's a layman example of what I mean:
Suppose there are two versions of your website. The desktop version at
d.example.com and the mobile version at
m.example.com. Also, assume both
m.example.com consist of content formatted correctly for the desktop screen and the mobile screen respectively.
Suppose you are using a mobile device to access
example.com. The server detects your device to be mobile and thus directs you to
m.example.com which displays the correct content.
Later someone uses the desktop computer to access
example.com. They are then forwarded to
At some point later, a hacker accessed your script and changed the website link of the desktop version to
h.example.com contains gibberish.
Now all users with desktop computers who access
example.com will be redirected to gibberish while users with mobile computers will be redirected to
m.example.com, the properly formatted site for mobile users.
As you may be aware, gibberish will never rank well unless the most awkward characters (that don't even spell English words) are searched for.