Skip to content
A simple changeset reverter with merge support
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Update readme for underscores Jun 21, 2016 Add Jun 22, 2016 Fix: duplicated node causes changes being rejected Oct 8, 2017 Download less in restore_version Nov 10, 2017 Turns out I could make a bulk request and spare a call Jul 6, 2016

Reverting Scripts

Here are two Python scripts that:

  • Revert simple OpenStreetMap changesets. Way and relation structural changes cannot be reverted, all other changes can. For example, if you deleted a lot of objects, or changed many tags at once.
  • Restore an old version of a given object. All of its deleted references are restored as well.

If there are no errors, scripts would ask you for OSM login and password (which are immediately forgotten) and upload the changes. Alternatively you can redirect output to a file and open it in e.g. JOSM for reviewing and uploading.


git clone
cd simple-revert

Or just press "Download ZIP" button above and unpack the archive.

Simple Revert

Specify changeset ids as the simple-revert script arguments. E.g.

./ 12345 12346 12348

To list recent changesets by a user (e.g. you), specify their name as the only argument:

./ Zverik

Restore Version

To restore an old object version, pass its type, id and version to restore_version. For the first argument you can use following formats:

  • n12345 for a node, w2342 or r234234 for ways and relations.
  • node/12345, node.12345 or even "way 2343" (note the quotes).
  • or any other similar link.
  • includes a version to restore.

Version number should be either a positive integer, or a negative, relative to the last version. E.g. this command will revert the last change to a node:

./ n12345 -1

To get a list of recent versions, run the script without a version argument.

Author and License

Written by Ilya Zverev, licensed WTFPL.

You can’t perform that action at this time.