As of ESXi 6.0 you can use the localcli command to unswap virtual machine memory while the VM is running.
See: I have memory pages swapped, can vSphere unswap them? - Yellow Bricks
Example:
First make sure the ESXi host has enough free memory to unswap the VM.
Then run ps | grep vmm0:<vmname> to get the world ID of the VM. The WID is in the first column of the output.
In this example we are unswapping 1 GB of memory for the VM with WID 1031226.
localcli --plugin-dir=/usr/lib/vmware/esxcli/int vm process unswap -w 1031226 -s 1 -u GB
Usage parameters:
-w XX : world ID of the VM (use ps | grep vmm0:<vmname>)
-s XX : number of units to unswap
-u XX : specify the units to use (GB or MB)
Note: unswapping memory can affect the VM. Sometimes the VM is paused while memory is unswapped, and if you are unswapping several gigabytes it could take a few minutes, so it might be better to unswap in small increments rather than unswapping all memory all at once.
Log Messages in vmkernel.log
Swap: vm 1031226: 4864: Starting prefault for the reg file
Swap: vm 1031226: 5175: Finish swapping in reg file. (faulted 262144 pages, pshared 12806 pages). Success.
Note: 1 memory page = 4KB