You want to pull out the longest path of nodes, iterate over the relationships and delete each one and then iterate over the nodes and delete them.
UPDATED ANSWER
Improvements to Cypher since this answer was posted allow now for nodes to be detached and deleted with a single command.
// match the path that you want to delete
MATCH p=(:Root {name: 'masterDoc'} )-[:previous*]->()
WITH p
// order it in descending order by length
ORDER by length(p) desc
// grab the longest one
LIMIT 1
// delete all of the relationships and their nodes
DETACH DELETE p
OLDER ANSWER
NOTE: This assumes that each node in the path is no longer anchored to anything other than the nodes in the path otherwise they will not be able to be removed.
// match the path that you want to delete
match p=(:Root {name: 'masterDoc'} )-[:previous*]->()
with p
// order it in descending order by length
order by length(p) desc
// grab the longest one
limit 1
// delete all of the relationships
foreach (r in relationships(p) | delete r)
// delete all of the remaining nodes
foreach (n in nodes(p) | delete n)