Each commit comes with a hash.
Let's say the hash of commit C
was abc123
you could do a simple git revert <hash>
$ git revert abc123
The git revert command undoes a committed snapshot. But, instead of removing the commit from the project history, it figures out how to undo the changes introduced by the commit and appends a new commit with the resulting content. This prevents Git from losing history, which is important for the integrity of your revision history and for reliable collaboration.
source
Edit:
According to your comment, you wanted to just revert a file rather than the entire commit. If this is the case, then consider the following:
commit B has a hash of abc456
.
$ git checkout abc456 -- /path/to/file.ext