How can I restore Matrix content after accidentally changing its field type? We accidentally deleted all our body text on all our pages, how do I redo my website to a older version. (24 hours ago)
We changed matrix to assets and after that every body text disappeared.
As John mentioned, restoring a database backup is your best bet.

If you don’t have a recent backup, you may still be able to get your Matrix content back, thanks to semi-bug where Craft doesn’t actually delete Matrix block content, when a Matrix field is converted to something else.

Here’s what you can try:


Enable the Project Config file for your site, if you don’t already have it enabled.
Figure out what your field’s uid is by looking up its row in your database’s fields table.
Find the most recent project config backup in storage/config-backups/ where your field was still a Matrix field. The most recent backup will be called project.yaml, the second most recent will be called project.yaml.1, and so on. For each file, search for &lt;field-uid&gt;: (replace &lt;field-uid&gt; with the UID from step 2). If the nested type property is set to craft\fields\Matrix, you’ve found the right file. It will look something like this:


8823155c-e84a-4a38-af30-2cb88b705e7b:
  name: Body
  handle: body
  instructions: ''
  searchable: true
  translationMethod: none
  translationKeyFormat: null
  type: craft\fields\Matrix
  settings:
    maxBlocks: '3'
    localizeBlocks: false
    contentTable: '{{%matrixcontent_testimonials}}'
  fieldGroup: d58a1faa-0bf6-46b2-b880-b0c14bebca75
  contentColumnType: string



Find the same field definition in your current config/project.yaml file, and replace it with the field definition from the backup you found in step 3.
As a sanity check, you may want to compare the config backup from step 3 with the subsequent backup (so if you found your matrix field in project.yaml.10, compare it with project.yaml.9), using a diff tool like FileMerge (comes with macOS) or Kaleidoscope. If there are any other significant changes that happened at the same time, you may want to revert those changes as well in config/project.yaml.
Now access your Control Panel and click the button to sync your new project.yaml changes. When that’s done, if all goes well, your field should be a Matrix field again, and your content will be restored.