I noticed that when I fold some text with zf and then press u for undo it does not undo the fold but undoes the last text editing action. Is there a general-purpose undo command which also would undo the action of having created some fold? It should be as if the command did not happen, so I can imagine the cursor returning to the end of the highlighted range where it was, for example.
You don't undo a fold, you open it with
zo or delete it with
zd (this doesn't delete content, only suppresses the notion that there's a fold there, closable with
In general, try
:help followed by the keystroke you've tried to find out more.
:help zf leads you to the topic of folds, and these other commands are documented there.