Remove Nitrokley from GPG settings

I need to remove Nitroykey from GPG, so that it will never ask for the hardware token again. I need to just use the a passphrase to use GPG because I have to fix some things and then in the future I will add the Nitrokey again.
Official GPG documentation is hard to use, could you please help me in doing it?
$ gpg2 --card-status correctly reports subkey that is used with Nitrokey
Thank you

Hi!

You need to remove the key’s stub. As far as I see you need to do so by hand, see:

E.g. in my case:

$ gpg2 --delete-secret-key szczepan@nitrokey.com
sec  rsa4096/D9BAE35991DE5B22 2016-01-11 Szczepan Zalega <szczepan.zalega@gmail.com>
                                                                                    
Delete this key from the keyring? (y/N) y                                           
This is a secret key! - really delete? (y/N) y                                      

### or by hand

$ gpg2  --with-keygrip -k szczepan@nitrokey.com | grep Keygrip
      Keygrip = B06F064034E06C022592DF7C411487BFA5E40AAD
      Keygrip = F6DA2A42DFCBA0CC25FF281178D8EDB17A648E91
pushd ~/.gnupg/private-keys-v1.d/ 
mv B06F064034E06C022592DF7C411487BFA5E40AAD* /tmp
mv F6DA2A42DFCBA0CC25FF281178D8EDB17A648E91* /tmp
popd

I agree it would be nice to have it in our documentation. CC @jan

Edit:
Later on just running gpg2 --card-status will make them recreated.

@szszszsz But a command like
gpg2 --delete-secret-key szczepan@nitrokey.com
would delete the entire key, not the subkey saved in the Nitrokey! Am I wrong?

GnuPG stores locally key stubs, which contain information that the key is on the external device (in this case Nitrokey). In case where you would like to stop asking for the key located on the Nitrokey, just removing the stub files will make the GnuPG unaware of the secret part location. Then you can import the key’s secret part (private key) backup to GnuPG, and use it as if you would never had it on the Nitrokey.

Could you elaborate, why do you want to remove only subkey stub? I am not sure if this is supported, but you can try so with the manual method I have listed above.