Skip to content

any easy way to revert last do, or rather undo last action? #324

Answered by inkarkat
vt128 asked this question in Q&A
Discussion options

You must be logged in to vote

todo.txt is modified by many actions, and in various ways (add tasks, delete tasks, modify parts of a task). Internally, these modifications are done via sed, and that creates the todo.txt.bak file.

For done.txt, it is only ever appended to, via the archive action (or auto-archiving if configured). So undoing here means removing task(s) from the end and moving them back to todo.txt. You don't need a backup file to do this correctly; a simple text editor (or sed) will do.

Unless you enable auto-archiving, the main undo procedure for accidentally done tasks is entirely in todo.txt; I usually would not use the .txt.bak file for that, but rather use the built-in replace action or a custom add…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by karbassi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #324 on December 12, 2020 16:08.