Find nixpkgs reference from before upgrade?

I have a pretty standard NixOS install that I upgraded for the first time a few days ago. One of the packages I use has broken, so I wanted to use the previous version that I had been using when running nix-shell -p R, so that I can run it with something like nix-shell -p R -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/ec750fd01963ab6b20ee1f0cb488754e8036d89d.tar.gz without having to rollback my whole system.

Is there an easy way to figure out the nixpkgs version that was used before?

ls -l /nix/var/nix/profiles/system*

That gives you timestamped paths to your system versions, with git hashes at the very right end.