diff --git a/src/plugins/qmldesigner/core/model/rewriterview.cpp b/src/plugins/qmldesigner/core/model/rewriterview.cpp
index eb3dd12e0d16f1e03fcc2cd677a08535da0ce0b3..d19d735a845cd6867c1554cf2542dc319fa68d88 100644
--- a/src/plugins/qmldesigner/core/model/rewriterview.cpp
+++ b/src/plugins/qmldesigner/core/model/rewriterview.cpp
@@ -438,6 +438,7 @@ void RewriterView::enterErrorState(const QString &errorMessage)
 
 void RewriterView::resetToLastCorrectQml()
 {
+    m_textModifier->textDocument()->setPlainText(lastCorrectQmlSource);
     ModelAmender differenceHandler(m_textToModelMerger.data());
     m_textToModelMerger->load(lastCorrectQmlSource.toUtf8(), differenceHandler);