how to undo git clean -fd command

C++
# Discarding local changes (permanently) to a file:
git checkout -- <file>

# Discard all local changes to all files permanently:
git reset --hardgit reset --hard
git clean -fdx
git reset --hard <your commit hash key>
git clean -fdxn

Source

Also in C++: