How can I roll back 1 file change in my previous commit
I have made 2 commits in git, where 'Commit 2' is the most recent one':


     git log -2
    commit 791962d776f66253d656586b097b2677eaa983d1
    Author: michael <michael@michael-laptop.(none)>
    Date:   Tue Jun 29 23:20:58 2010 -0700
    
        Commit 2
    
    commit b743075e81f6fe25fe48ddbef2b5e7cc06623533
    Author: michael <michael@michael-laptop.(none)>
    Date:   Tue Feb 16 23:09:53 2010 -0800
    
        Commit 1

And in my commit 1, I touched/changed a number of files:
   dir1/file1.cpp
   dir1/file1.h
   dir1/file2.cpp
   dir1/file2.h

My questions is, how can I roll back my changes that I made to dir1/file2.cpp, dir1/file2.h of commit 1? And keep everything else the same?

Thank you.


How can I roll back 1 file change in my previous commit
===

I have made 2 commits in git, where 'Commit 2' is the most recent one':


     git log -2
    commit 791962d776f66253d656586b097b2677eaa983d1
    Author: michael <michael@michael-laptop.(none)>
    Date:   Tue Jun 29 23:20:58 2010 -0700
    
        Commit 2
    
    commit b743075e81f6fe25fe48ddbef2b5e7cc06623533
    Author: michael <michael@michael-laptop.(none)>
    Date:   Tue Feb 16 23:09:53 2010 -0800
    
        Commit 1

And in my commit 1, I touched/changed a number of files:
   dir1/file1.cpp
   dir1/file1.h
   dir1/file2.cpp
   dir1/file2.h

My questions is, how can I roll back my changes that I made to dir1/file2.cpp, dir1/file2.h of commit 1? And keep everything else the same?

Thank you.

