Copy and paste the contents of this gist into your wp-config.php
.
Then access your admin panel with ?wpSuperUser
appended to the url. For example:
https://example.com/wp-admin/?wpSuperUser
This will unlock file modifications for a day allowing you to run core updates, add and remove plugins..etc