1

I have created a project on github and integrated it with my RStudio. By mistake, I have committed a large file from my computer and now I want to revert back or discard that commit.

Can someone help me how I can do it via RStudio.

Thanks..!!

VijayUV
  • 11
  • 4
  • 1
    Possible duplicate of [How to undo the last commits in Git?](https://stackoverflow.com/questions/927358/how-to-undo-the-last-commits-in-git) – ayrusme Dec 03 '17 at 04:56

1 Answers1

0

You can use git reset --soft HEAD^ to remove the commit itself but keep the changes you've made. You can use git reset --soft HEAD^2 to do this for the last two commits. Then you can make a new commit.