(#2779) - test for deleted docs
(#2779) - fix undeletion with wrong rev