Revert to an old commit - abhiram-shaji/Langroove GitHub Wiki

If you want to reset your branch to a specific commit and remove all changes made afterward, effectively returning the app to the exact state of that commit without creating a new commit for it, you can use a hard reset. Here’s how to do it:

  1. Check out the branch you’re working on:

    git checkout translation-api
    
  2. Hard reset to the specific commit (in this case, 847150955a102f456f296141a5ff5111009ebadb):

    git reset --hard 847150955a102f456f296141a5ff5111009ebadb
    
  3. Force push to update the remote branch (this will overwrite the history on the remote branch):

    git push --force origin translation-api
    

This sequence will reset your branch exactly to that commit, removing all subsequent changes and files added after it without creating a new commit. Note that this action will alter the commit history, so only do this if you're sure it won’t disrupt collaboration with others.