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
67
votes
4 answers
Is there any way to undo the effects of "git revert head"?
I've accidentally run the command against the wrong branch in my repository - is there a way to undo this change?

blueberryfields
- 45,910
- 28
- 89
- 168
54
votes
3 answers
What are the differences between 'revert', 'amend,' 'rollback', and 'undo' a commit?
To help in my knowledge of git so I can use it day to day, what is the difference between:
revert
amend
rollback
undo
What are they and what do they do?

gosbi
- 755
- 1
- 6
- 13
52
votes
4 answers
How to undo a merge (without commit)?
I just did an svn merge to merge changes from the trunk to a branch:
$ svn merge -r328:HEAD file:///home/user/svn/repos/proj/trunk .
--- Merging r388 through r500 into '.':
A foo
A bar
C baz1
C baz2
U duh
[...]
But there were too…

Frank
- 64,140
- 93
- 237
- 324
37
votes
2 answers
Autotools: how to cleanup files created by "./configure" in lighttpd project?
I'm trying out lighttpd for an embedded Linux project. I got the latest source package and started writing a master Makefile encapsulating all configure, compile, install (for testing) etc stuff.
And vice-versa, I want to cleanup every step. After…

Andi
- 888
- 2
- 10
- 24
36
votes
4 answers
How to perform the TFS-equivalent of 'Undo pending changes'
How do I perform the equivalent of the TFS 'Undo pending changes' in Git, on one or multiple files?
That basically means to do these steps:
Undo changes on disk
Resetting any changes Git has discovered
Getting the latest changes on the file from…

Seb Nilsson
- 26,200
- 30
- 103
- 130
34
votes
1 answer
Vim undo: undo changes after file write
In my code on vim, I did a lot of changes and then did a ZZ (save and exit). But then I realized I didn't need those changes. Is there a way I can get back to the state before doing those changes using from some buffer where that data still might be…

brokenfoot
- 11,083
- 10
- 59
- 80
33
votes
1 answer
how to undo git submodule update
I accidentally checked in a wrong submodule update: ( as part of a bigger commit )
-Subproject commit 025ffc
+Subproject commit f59250
It is already pushed to the remote..
How do I undo this update?

Tom Fishman
- 1,716
- 6
- 22
- 36
33
votes
3 answers
Undoing specific revisions in Subversion
Suppose I have a set of commits in a repository folder...
123 (250 new files, 137 changed files, 14 deleted files)
122 (150 changed files)
121 (renamed folder)
120 (90 changed files)
119 (115 changed files, 14 deleted files, 12 added files)
118 (113…

Ed Guiness
- 34,602
- 16
- 110
- 145
32
votes
3 answers
How do I revert a file to 'last checkin' state in Mercurial?
I have a hypothetical Mercurial repository on disc. I'm most of the way through creating a new feature, when I realise I've made a complete mess of the file I'm working on, and want to revert that file back to its last commit state.
I can use hg…

richzilla
- 40,440
- 14
- 56
- 86
31
votes
6 answers
Visual Studio : exclude outlining from undo/redo stack
There's something really annoying in Visual Studio : when I expand or collapse a method or code region, this action is pushed on the undo stack. So if I edit some code in a method, then collapse that method, and then want to undo my change, I have…

Thomas Levesque
- 286,951
- 70
- 623
- 758
30
votes
3 answers
How to recover the deleted files using "rm -R" command in linux server?
I have unfortunately deleted some important files and folders using 'rm -R ' command in Linux server.
Is there any way to recover?

Srini
- 309
- 1
- 3
- 3
30
votes
4 answers
How to undo all added files in Mercurial
Say I type hg add in Mercurial, and there a bunch of untracked files in my working directory that are not ignored. What is the easiest way to un-add all those files without explicitly typing the name of each file?
Can I just un-add them all with one…

PICyourBrain
- 9,976
- 26
- 91
- 136
30
votes
12 answers
How can I "undo" the programmatic insertion of text into a textarea?
I have a textarea and a button. Clicking the button causes text to be inserted into the textarea.
Is there a way to allow a user to press Ctrl/Cmd+z to undo the insertion of text and revert the textarea to its previous state?

sluther
- 1,694
- 20
- 29
29
votes
7 answers
Force IE contentEditable element to create line breaks on Enter key, without breaking Undo
On Internet Explorer, a contentEditable DIV creates a new paragraph () each time you press Enter whereas Firefox creates a
tag. As discussed here, it is possible to use JavaScript to intercept the Enter keyPress and use range.pasteHTML…
tag. As discussed here, it is possible to use JavaScript to intercept the Enter keyPress and use range.pasteHTML…

Dan Fabulich
- 37,506
- 41
- 139
- 175
27
votes
1 answer
How can I undo my last git add/commit?
I edited a file and did:
git add file.py
git commit -m 'fixed bug'
I then edited another file and performed a minor bug fix. I don't want two commits, one after the other, showing 'bug fix'. I want one commit with 'bug fixes'.
How can I undo the…

dave
- 7,717
- 19
- 68
- 100