ByteContent (RootEntry root, String path, Change change) { root = root.copy(); String newPath = revertUpTo(root, path, null, change, false, false); Entry entry = root.findEntry(newPath); if (entry == null) return new ByteContent(false, null); if (entry.isDirectory()) return new ByteContent(true, null); return new ByteContent(false, entry.getContent().getBytesIfAvailable()); }