Undo is a command in many computer programs. It erases the last change done to the document reverting it to an older state. In some more advanced programs such as graphic processing, undo will negate the last command done to the file being edited.
Questions tagged [undo]
854 questions
19
votes
5 answers
Undo for a paint program
I am looking into how to write a paint program that supports undo and seeing that, most likely, a command pattern is what I want. Something still escapes me, though, and I'm hoping someone can provide a simple answer or confirmation.
Basically, if…

Joey
- 7,537
- 12
- 52
- 104
19
votes
4 answers
How do I get fine-grained undo in Vim
I find Vim's undo to be a bit too coarse. E.g. if I type something like this:
a // to go into edit mode
to be or not to ve
// to exit insert mode
Oops! I made a typo. I want to start undoing so I press u, but then it clears the whole line. Is…

MDCore
- 17,583
- 8
- 43
- 48
17
votes
8 answers
How to design undo & redo in text editor?
Part of my project is to write a text editor that is used for typing some rules, compiling my application and running it. Writing compiler was end and release beta version. In the final version we must add undo and redo to the text editor. I use a…

Sajad Bahmani
- 17,325
- 27
- 86
- 108
16
votes
3 answers
How to undo an 'svn copy'
I've accidentally overwritten an old branch by copying trunk over it using 'svn copy'. More specifically, for every release, trunk is branched and kept as a tag, using:
svn copy svn://machine/REPOS/trunk svn://machine/REPOS/tags/$RELEASENR
But this…

vahidg
- 3,953
- 2
- 22
- 30
16
votes
3 answers
Implementing undo
I'm creating a map editing webapp where we can create and edit polylines, polygons etc. I've some trouble finding informations on undo implementation on the web, I find whining about "we need undo" and "here is my Command pattern using closures" but…

nraynaud
- 4,924
- 7
- 39
- 54
16
votes
5 answers
What's the best way to implement gmail style "undo" in Rails?
I think it important to have an "undo" method ala gmail when destroying records instead of displaying an annoying popup that says, "Are you sure?".
The way that I've implemented this is to have a "deleted_at" timestamp column in the model which gets…

JasonOng
- 3,268
- 3
- 21
- 17
16
votes
2 answers
Undo and Redo in WYSYWYG contentEditable in SWT doesn't work
I'm doing a WYSYWYG HTML5 editor With SWT by setting the contentEditable attribute of the body tag to true.
When I'm executing some commands like document.execCommand('bold'), it works perfectly. But when I try to undo an operation with…

Jbprod
- 209
- 2
- 8
16
votes
3 answers
How do I implement a simple undo/redo for actions in java?
I've created an XML editor and I'm stuck at the last phase: adding undo/redo functionality.
I've only got to add undo/redo for when users add elements, attributes, or text to the JTree.
I'm still quite new at this but in school today I attempted…

Chea Indian
- 677
- 3
- 9
- 16
15
votes
3 answers
How to implement an "undo" feature using Python/Django
I have a Django application where I allow a user to import a CSV file with contact data (membership #, first name, last name, etc).
When they import the file, the application checks the database for a matching record and either: 1) inserts a new…

Ben S
- 1,407
- 1
- 13
- 27
15
votes
1 answer
Undoing the last point in OL3 removes the last segment
I need a functionality in my web app for undoing the last point. There has been some solutions such as this for the given problem which can handle it to some extent:
var undo = false; // set this to true in the Esc key handler
var draw = new…

msc87
- 943
- 3
- 17
- 39
14
votes
8 answers
How to undo git rm -rf dirname without a first commit?
I did:
git init
git add .
git rm -rf dirname
Looking at other answsers, git reset --hard HEAD, git checkout -f and git reflog did not work, apparently because there is no HEAD to go back to, nor a commit to get the files back from.
Is there a way…

B Seven
- 44,484
- 66
- 240
- 385
14
votes
8 answers
How to handle touch outside the view in Android?
I've found implementation of "Undo Bar" used in Gmail application for Android. "UndoBar" is basically a View that is displayed on top of the layout.
Unfortunately it's not complete - it has no functionality of dismissing bar by touching screen…

pixel
- 24,905
- 36
- 149
- 251
14
votes
2 answers
Git undo partial changes to a file
How do I undo a part of the changes applied to a file that happened a while a go.
I have the following commits and the accidental changes happened between A and B to 'file.txt'
...--A--B--...
I have a diff patch of the file in file.txt-B-A.patch…

camillobruni
- 2,298
- 16
- 26
13
votes
3 answers
Implementing Undo and Redo functionality javascript and php
I want to implement Undo and Redo functionality not only for client side but for server side as well. For insatnce i have a div containing image and i can rotate resize and rewrite it , All the basic operations for image generation. And all of the…

hashmi
- 651
- 2
- 9
- 24
13
votes
2 answers
Examples of "undoable" applicative functors?
I declared a group on applicative functors. Judging by what we usually call "actions", it seems that such group would enable the action to be undone:
import Control.Applicative
class Alternative f => Undoable f where
undo :: f a -> f a
Being a…

Dannyu NDos
- 2,458
- 13
- 32