The account is that Guru Nanak Dev Ji and Bhai Mardana Ji came to Hasan Abdal, where a faqir called Wali Kandhari controlled the only spring, on a hill, and refused water.
He was sent up twice and refused twice. A stone lifted at the foot of the hill brought water, and the one above it dried. The account then has a boulder pushed down from the top and stopped by an open palm, which left a print in the rock.
Gurdwara Panja Sahib is built around that rock and around the spring. It is one of the most visited Sikh sites in Pakistan and Indian jathas go to it under the 1974 shrine protocol.
On 30 October 1922, during the Guru ka Bagh morcha, Sikhs at Hasan Abdal lay across the railway line to stop a train carrying arrested Akali prisoners so that they could be given food. The train did not stop in time. Bhai Karam Singh and Bhai Partap Singh were killed and the episode is remembered as the Saka Panja Sahib.
A pilgrimage site attached to a story about water refused is also the site of an incident about food being given, which is a coincidence worth noticing.
Hasan Abdal is in Attock district on the Grand Trunk Road and it was a stage on the route to Kabul long before any of this. A Mughal garden and a Mughal tomb stand a short distance from the gurdwara. Armies going in both directions stopped here for a thousand years, for the same reason anybody stopped, which was the water.
The spring at the site runs and the sarovar is filled from it, and the Baisakhi gathering there is one of the two largest Indian pilgrimages into Pakistan.
The story is about a man who would not give water and it is told for that rather than for the miracle. What is remembered is the refusal, not the rock.