Is there any shortcut way where I can bring my virtual machine back to the new original state. I don’t want to create a new virtual machine, instead I want to revert my machine back to factory defaults. Basically I want to do this for my Ubuntu VM.
I'd recommend you take a look at Vagrant - https://docs.vagrantup.com/v2/. Tearing down a VM is as simple as running 'vagrant destroy' from the command line. When you're ready to bring it back up, you can re-provision with 'vagrant up'
Most virtualization software supports snapshots.
A snapshot is the state of a system at a particular point in time.
The free/open-source Virtualbox supports snapshot creation and restoring from the command line. Also VMWare Workstation supports snapshots from the commandline with the revertToSnapshot option.
Keep in mind that a snapshotted machine will be somewhat slower since it has to keep track of all changes made to the disk.