Question

I am coding in javascript a very big file and I keep wanting to go back to a previous version because of bugs I have created in the new version. Are there any code editors that allow you to revert to a previous version of the code?

Was it helpful?

Solution

I think what you need is not a specific editor. You need a version control system like Subversion or git. So you can still keep using your favourite editor.

Subversion (http://subversion.tigris.org/)

Git (http://git-scm.com/)

OTHER TIPS

This is called Version Control and is something every developer should use by default. There are many version control systems, have a look at SVN, Git, Mercurial, et al.

Some editors are integrated with a version control system, but it's always a separate system.

Yes, both Emacs and Vim can do this:

http://www.emacswiki.org/emacs/RevisionControlSystem

http://www.vim.org/scripts/script.php?script_id=89

However, I agree with the other answers, a version control system would be more appropriate and easier to learn (assuming you don't already know Emacs or Vim).

I very much agree with Prine's answer -- you're probably looking for version control, and many editors support it natively. However, if you're just looking for an editor that will show you changes you just made in the last few minutes, vim and emacs both have the concept of "undo trees" that let you visualize the undos and rewrites you've made in the course of a session:

Screenshot of Emacs' undo tree
(source: briancarper.net)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top