I made a simple version control and undo function. (Since it uses system commands right now it is only tested for Linux. Windows support is added but not tested. MacOS is not tested either.)
Here is the link to undo.m or the github if you just want to try it (and trust me enough to run the code without checking) run
Would be great to have some feedback with ideas how to improve it, also I didn't test this a lot but it seems to be working fine. It is probably not the most efficient way but I think it is a good start.
From the readme:
This package adds a poor mans version control and undo functionality to Mathematica.
For a previously saved notebook 'notebook.nb' a version info file 'notebook.nb.undo.mx' is created and every time changes are committed a backup file 'notebook.nb[version].bak' is created.
System menu entries in insert are created.
Alt+z : Undo
Alt+x : Redo
Alt+s : Commit
Alt+d : Opens CommitInfo Dialog
Usage: Evaluate the following commands
ManualCommit (Default) - Only do commits manually.
AutoCommit - Turn on automatic commits. Every time a cell is evaluated a new commit is made. (This can lead to a lot of files)
CronCommit[n] - makes a new commit every n minutes.
CommitNow - Making a commit
CommitInfo - Show a list of all Versions
CommitClean - Remove all commited files
Undo - Undo to the previous commit
Redo - Undo to the next commit
GotoCommit[n] - Go to the n-th version
When altering not the latest version, the changes (when running undo or redo) are not saved, only when running 'commit' these changes are changed (with a new highest version number). Only changes to the version with the highest version number are changed upon 'undo'
Whether a commit needs to be made when running undo is checked with a system variable that can be altered by manually saving the document. Leading to possible loss of changes. For best results do not save the notebook manually and turn auto save off - just use commit to save the work.
EDIT: This version also has problems with individual context for each notebook, so just be warned. :)
CTRLkey (or its equivalent on other platforms) yet. $\endgroup$
Undomultiple times, don't let
Ctrlget in your way. $\endgroup$