While you can update the app from the web interface, from time to time we have to ship an update to the underlying environment Discourse runs (the container image). Those environmental updates require a rebuild.
For undoing your local changes, you may be able to stash those with
cd /var/discourse
git stash
./launcher rebuild app