In order to recover from this situation, I followed these steps : ( in case someone is stuck in the same situation )
1- reboot and hit escape during boot time , in order to get the grub menu.
2- choose the ( recovery ) option in order to boot in safe mode.
3- while booting , the recovery menu show up. Choose the option "failsafeX".
4- a new window will show up asking what do you want to do: use the mouse to select the option "Exit to console login" then resume the boot till the login prompt appears.
5- uninstall the following package : xserver-xorg-video-intel
sudo apt-get remove xserver-xorg-video-intel
6- install back the following packages : ubuntu-desktop, xserver-xorg
sudo apt-get install ubuntu-desktop xserver-xorg
7- for some reason, on my home directory, ~/.Xauthority changed the ownership to root:root which was not expected. Due to this permission change, I was not able to login after rebooting, but the mouse and the keyboard were back. To fix this issue, make sure that ~/.Xauthority is owned by you.
sudo chown : ~/.Xauthority
8- reboot
Hope that helps !
xserver-xorg-video-intel
and your solution worked perfectly. – razzak Jun 30 '19 at 22:04