Can I restore a plugin that was accidentally deleted? (on localhost)

Shot answer: It depends.

  • If you store your wordpress in a partition which do not contain OS, you get higher chance to recovery it.
  • If you has not rebooted your PC, you get higher chance.
  • If you’ve just deleted your plugins, you’re likely to be able to recover it.

Try some data recovery softwares (like Recover My Files – Data Recovery) as soon as posible. I tried it sometimes in the past and have good result.

Next times, you should use a version control software like git and a remote git hosted service like github or bitbucket to save your ass.

Good luck buddy!