The poem
"O passenger, pray list and catch Our sighs and piteous groans, Half stifled in this jumbled patch Of wrenched memorial stones!
"We late-lamented, resting here, Are mixed to human jam, And each to each exclaims in fear, 'I know not which I am!'
"The wicked people have annexed The verses on the good; A roaring drunkard sports the text Teetotal Tommy should!
"Where we are huddled none can trace, And if our names remain, They pave some path or p-ing place Where we have never lain!
"There's not a modest maiden elf But dreads the final Trumpet, Lest half of her should rise herself, And half some local strumpet!
"From restorations of Thy fane, From smoothings of Thy sward, From zealous Churchmen's pick and plane Deliver us O Lord! Amen!"

Thomas Hardy was a young architectural assistant working on the train station - St. Pancras Station, London, completed in 1868 and became the largest enclosed structure in the world at that time. The location was just south of Regent's Canal and St. Pancras Church, named after an early Christian martyr who died at the age of 14.
To pass the canal, engineers had to build a bridge and relocate St. Pancras cemetary. Thomas Hardy never forgot the sight of coffins being moved and later wrote this poem.
Thomas Hardy was rather more involved with the church of St Pancras than the station. The viaduct leading into the station crossed part of the burial ground of St Pancras Church and excavations for the viaduct required disturbance to a large number of inhuamtions. Hardy was employed by William Blomfield to oversee the exhumation of the burial ground to try and ensure it was effected in a dignified manner. Hardy's poem suggests the exhumation work remained a lasting memory. There is a tree in the present day St Pancras Gardens which grows through a pile of massed gravestones which has been christened the 'Hardy Tree'.
this poem, i think, is about Hardy's feelings towards actually watching the bodies being dug up and then moved around. He feels as if the spirits are talking to him saying that they do not want their bodies to be put back into the wrong graves, as this may be a gravestones marked wrongly. An example would be a drunkard being put into a grave with the label of teetotal, and Hardy is putting across through this poem that this is how the people would have felt, as they will now be lying in graves where they "have never lain before".