If you forgot your username & password for your nexus switch
Commands-> Reboot the device and press
ctrl+c
cmdline recoverymode=1
boot (Image)
Your device will restart press,
ctrl-j
conf t
admin-password XXXXXXXX
exit
load-nxos
You can know able to access your switch.