How to undo a git commit and rollback to previous version for selected file only?

I have committed few files in local. Now I want to rollback 1 file to previous version.

Example:
committed: A, B, C

  • git - how to handle confilicts
  • how to sync repos of bitbucket on github?
  • Is it possible to create a Heroku review app from a Bitbucket pull request
  • SVN to Git conversion - branches not pushed to Bitbucket
  • Difference Between Bitbucket Service Hooks Post and Pull Request Post
  • Cloning a pull request
  • Want to:
    commit: A, C
    Rollback: B

    Can anyone help me?

    Thanks.

  • Why git operations becomes slow when repo gets bigger
  • cloning submodule fails
  • Elastic Beanstalk pull application files locally
  • How can I keep track of where commits came from once they've been merged?
  • Git - forcefully ask for credentials on every push?
  • Can Eclipse's Refactor > Move be integrated with Git?
  • One Solution collect form web for “How to undo a git commit and rollback to previous version for selected file only?”

    You want to use git checkout or git show:

    git checkout B -- path/to/file
    

    Or:

    git show B:./path/to/file > ./path/to/file
    

    Then add and commit as usual.

    Git Baby is a git and github fan, let's start git clone.