InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Svn tutorials

  • Diff last committed change
  • Edit log message for a committed revision
  • Make file executable on Linux
  • Recover svn lost password on Linux
  • Short diff without context
  • Svn log of all files in a directory
  • Svn log of entire repository
  • Undo last commit
  • View older version of a file
 
  • Home
  • > Tutorials
  • > Svn

svn – how to undo last commit

By admin on Nov 23, 2015

Often we need to undo our last commit or an old recent commit in svn. These are quick steps you can follow to undo last commit. These needs to be done in svn working directory. Also it is better you don’t have other changes in that working directory.

get last revision id in svn

First we need the revision id of the last commit. Here is how you can get it:

$ svn update
$ svn log -l 1
------------------------------------------------------------------------
r3745 | user1 | 2015-11-23 03:10:50 +0000 (Mon, 23 Nov 2015) | 2 lines

blah blah bla

------------------------------------------------------------------------

Ensure that the revision id is correct by reviewing the commit message.

Undo a specific revision in svn

To undo a specific revision you can use the following command:

$ svn merge -c -r3745 .

This will create the undo changes in your working copy. Now you can review these and commit:

$ svn diff
$ svn commit

In case you have other edited files in working directory, you can commit only the relevant files.

$ svn diff [relevant_files]
$ svn commit [relevant_files]

Please note that undoing actually will mean you create a new revision with the negatives changes of last commit.

Suggested posts:

  1. How to recover svn lost password on Linux
  2. WordPress – write custom php log to separate file
  3. Git log with file names
  4. Svn – short diff without context
  5. Git – Check if a hash is valid
  6. Php equal (==) vs identical (===)
  7. Iterate over specific file extension in a dir in shell script
  8. How to change twitter handle and its impact on traffic
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Mac, Svn, Tutorials, Ubuntu Linux
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress