Uploaded the following sample code in Github.
https://github.com/NomuraS/qiita-undo-redo-vis.js
Undo/Redo functions are not natively supported in Vis.js. So, such functions would give us better experiences if we dynamically manipulate a graph of Vis.js. See and try the following example of CodePen (which is based on one of examples in the official site).
See the Pen undo/redo on Vis.js by NomuraS (@NomuraS) on CodePen.
The example depends on jQuery and lodash.js. While I'm not one to avoid using lodash.js, the library is used only for the function "_.differenceBy".