JSFiddle - React, Tailwind, and code Playground

HTML

<div id="box"></div><br>
<button id="btn-remover">Editar</button>
<button id="btn-restaurar">Restaurar</button>

CSS

#box {
    width:100px;
    height:100px;
    background: red;
}

JavaScript

var elementoOriginal = $("#box").clone();

$("#btn-remover").click(function() {
    $("#box").css('background','yellow');
});


$("#btn-restaurar").click(function() {
    $("#box").remove();
    $("body").prepend(elementoOriginal);
});