The \revert command

Once overridden, the property retains its new value until it is overridden again or a \revert command is encountered. The \revert command has the following syntax and causes the value of the property to revert to its original default value; note, not its previous value if several \override commands have been issued.3

\revert Context.LayoutObject.layout-property

Again, just like Context in the \override command, Context is often not needed. It will be omitted in many of the following examples. Here we revert the color of the note head to the default value for the final two notes:

\relative {
  c'4 d
  \override NoteHead.color = "red"
  e4 f |
  \override NoteHead.color = "green"
  g4 a
  \revert NoteHead.color
  b4 c |
}

[image of music]


Footnotes

(3)

The behaviour of \revert can be changed by using \temporary \override; see Intermediate substitution functions.


LilyPond Learning Manual v2.25.22 (development-branch).