Save next before you turn the arrow.
transcript
This reverse loses almost the whole list. It compiles. It runs. No error appears. The bug is one line in the wrong place. Here is how it happens.
Reverse one, two, three, four. Each step turns one arrow back. Two cursors walk: prev and curr. Prev starts at null. Curr starts at the head.
The bug turns the arrow first. Node one now points at null. So where is node two? Nothing leads there now.
The fix: save curr's next first. Then turn the arrow. Next still holds node two. Move on safely.
On four nodes, the bug keeps one. Three nodes are lost for good. On a long thread, it loses thousands. A test with three nodes catches it at once.
The rule works for every pointer change. Save what you are about to overwrite. Then change the pointer. And check for null before each hop.
Save, then turn. Your list stays whole. Try it in the sandbox, step by step. Full breakdown in the lecture.