Next time, I suggest using a breaker lockout [0] in conjunction with the local disconnecting means (light switch, which you can also lock out! [1]) to do it safely :)
[0] https://www.walmart.com/ip/MASTER-LOCK-493B-Circuit-Breaker-...
[1] https://www.homedepot.com/p/Ideal-Wall-Switch-Lockout-44-789...