Hi Bastien,

Thank you for your response. This still happens for me on the version built from the org-mode.git repository.

Here is a test .org file (also attached):

----
* TODO [0/4] Project 1
** Category 1
*** TODO Task 1
*** TODO Task 2
** Category 2
*** TODO Task 3
*** TODO Task 4
* TODO [0/4] Project 2
** Category 3
*** TODO Task 5
*** TODO Task 6
** Category 4
*** TODO Task 7
*** TODO Task 8
----

Here are the steps I followed (using emacs -q) to reproduce the issue:

1. emacs -q test.org
2. M-x, customize variable
3. org-hierarchical-todo-statistics
4. Toggle --> off,
5. State --> 0, "Set for current session"
6. back to test.org
7. M-x, org-agenda
8. < (restricted to buffer)
9. t "List of all TODO entries"
10. place cursor box on "Project 1" line
11. ^ ("org-agenda-filter-by-top-headline") ("Project 2" and descendants disappear)
12. cursor box over "Task 1"
13. t (mark "Task 1" DONE)

This makes "Task 1" disappear from the agenda on my machine. The same happens when I mark "Task 2" as done. Pressing "g" makes "Project 1" and all remaining descendant tasks disappear.

Please let me know if I can provide any more information.

Will

On Sun, May 24, 2020 at 7:03 AM Bastien <bzg@gnu.org> wrote:
Hi William,

William Horne <will.m.horne@gmail.com> writes:

> Unfortunately, it appears that doing both at once triggers the
> following behavior: with Org Hierarchical Todo Statistics set to
> nil, marking an item DONE in the agenda while it is filtered by top
> headline makes it disappear from the agenda, leave a blank line in
> its place, and become irretrievable through undo.

thanks for the detailed report.  I tried to reproduce the issue with
an .org file I wrote, but I could not reproduce the problem.

Do you still have this issue with latest Org?

If so, can you provide a minimal .org file to let us reproduce the
problem with emacs -q?

Thanks,

--
 Bastien