Now when I import the key again, it gives me 'null'.
when importing private key, it returns
null on success
So I want to somehow like 'roll-back' what I did and to let the wallet re-scan the private key again.
you can do
importprivkey "yourprivatekey" "" true second parameter is empty string to assign address to default account
third parameter is
true to rescan local blockchain, but if the address already exist in the wallet this won't work
so in your case, you can do that only by restarting wallet with
-rescan command-line argument