diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts index 382fce7d995..8dfb595f64c 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts @@ -133,7 +133,7 @@ export class NotebookEditorInput extends EditorInput { } async revert(group: GroupIdentifier, options?: IRevertOptions): Promise { - if (this._textModel) { + if (this._textModel && this._textModel.object.isDirty()) { await this._textModel.object.revert(options); }