public void deleteCurrentVersion() throws IOException {
		synchronized (syncObject) {
			if (minVersion == currentVersion) {
				throw new IOException("Unable to delete last remaining version");
			}

			// Re-build buffer file for (currentVersion-1)
			int prevVer = currentVersion - 1;
			File prevBFile = bfMgr.getBufferFile(prevVer);
			if (!prevBFile.exists()) {
				LocalBufferFile srcBf = openBufferFile(prevVer, -1);
				try {
					srcBf.clone(prevBFile, null);
				}
				catch (CancelledException e) {
					throw new AssertException();
				}
				finally {
					try {
						srcBf.close();
					}
					catch (IOException e) {
						// ignore
					}
				}
			}

			// Rename previous version/change files
			File versionFile = bfMgr.getVersionFile(prevVer);
			File changeFile = bfMgr.getChangeDataFile(prevVer);
			File delVersionFile =
				new File(versionFile.getParentFile(), versionFile.getName() + ".delete");
			File delChangeFile =
				new File(changeFile.getParentFile(), changeFile.getName() + ".delete");
			delVersionFile.delete();
			delChangeFile.delete();

			if (!versionFile.renameTo(delVersionFile)) {
				throw new FileInUseException("Version " + prevVer + " is in use");
			}
			else if (!changeFile.renameTo(delChangeFile)) {
				delVersionFile.renameTo(versionFile);
				throw new FileInUseException("Version " + prevVer + " is in use");
			}

			// Remove current version
			if (!bfMgr.getBufferFile(currentVersion).delete()) {
				prevBFile.delete();
				delVersionFile.renameTo(versionFile);
				delChangeFile.renameTo(changeFile);
				throw new FileInUseException("Version " + currentVersion + " is in use");
			}

			// Complete removal
			delVersionFile.delete();
			delChangeFile.delete();
			int deletedVersion = currentVersion--;
			verDBListener.versionDeleted(deletedVersion);
		}
	}
Delete latest version.
@throws IOException if an error occurs or this is the only version.
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/db/VersionedDatabase.java