---
title: "RESTORE_REGISTER"
manual: "TypoScript Explained"
version: "14.3"
permalink: "https://docs.typo3.org/permalink/t3tsref:cobj-restore-register@14.3"
source: "ContentObjects/RestoreRegister/Index.rst"
rendered: "2026-10-01T16:17:37+00:00"
---

# RESTORE_REGISTER {#cobj-restore-register}

This unsets the latest changes in the register array as set by
[LOAD_REGISTER](https://docs.typo3.org/permalink/t3tsref:cobj-load-register@14.3).

Internally registers work like a stack where the original register is
saved when [LOAD_REGISTER](https://docs.typo3.org/permalink/t3tsref:cobj-load-register@14.3) is called. When a
RESTORE_REGISTER cObject is called, the last element is pulled off
that stack and the register is replaced with the content of the
previous element.

> [!NOTE]
> `RESTORE_REGISTER` has no properties.

-   [Example:](https://docs.typo3.org/permalink/t3tsref:example@14.3)

## Example: {#cobj-restore-register-examples}

The following example shows how LOAD_REGISTER and RESTORE_REGISTER can
be used to load values into the register and to restore previous values
again.

**EXT:my_sitepackage/Configuration/Sets/Main/setup.typoscript**

```typoscript
# Put first block into the register
10 = LOAD_REGISTER
10 {
  myTextRegister.cObject = COA
  myTextRegister.cObject {
    10 = TEXT
    10.value = This is text in the first block.
    10.stdWrap.wrap = <p>|</p>
  }
}
# Put second block into the register
20 = LOAD_REGISTER
20 {
  myTextRegister.cObject = COA
  myTextRegister.cObject {
    10 = TEXT
    10.value = This is text originally used in the second block...
    10.stdWrap.wrap = <p>|</p>
  }
}
# Put third block into the register using text from the second block.
30 = LOAD_REGISTER
30 {
  myTextRegister.cObject = COA
  myTextRegister.cObject {
    # Get the current text from myTextRegister:
    # "This is text originally used in the second block..."
    10 = TEXT
    10.stdWrap.data = register:myTextRegister
    10.stdWrap.append = TEXT
    10.stdWrap.append.value = (but now used in the third block).
    20 = TEXT
    20.value = This is a second text in the third block.
    20.stdWrap.wrap = <p>|</p>
  }
}
# Up to this place no actual output has been produced.

# Outputs block 30 "This is text originally used in the second block...
# (but now used in the third block). This is a second text in the third block."
40 = TEXT
40.stdWrap.data = register:myTextRegister

# Outputs block 20 "This is text originally used in the second block..."
50 = RESTORE_REGISTER
60 = TEXT
60.stdWrap.data = register:myTextRegister

# Outputs block 10 "This is text in the first block."
70 = RESTORE_REGISTER
80 = TEXT
80.stdWrap.data = register:myTextRegister

```
