Install git-repair by entering the following commands in the terminal:
sudo apt update sudo apt install git-repair
Description:
repair various forms of damage to git repositories
git-repair can repair various forms of damage to git repositories. . It is a complement to git fsck, which finds problems, but does not fix them. . As well as avoiding the need to rm -rf a damaged repository and re-clone, using git-repair can help rescue commits you've made to the damaged repository and not yet pushed out.
Homepage: http://git-repair.branchable.com/
Version: 1.20151215-1.1
Section: universe/utils