79097699

Date: 2024-10-17 10:48:18
Score: 1.5
Natty:
Report link

I love @Spencer's idea above and I almost used the same approach.

You can just do the following steps, without having to follow any complex apporaches.

git reset --soft <commit-id> (or HEAD~<n>)
git stash save <commit message>

This will save your last commit's content into the stash directory (and replace the n with how many last commits you want to revert).

Just to be safe you can also checkout to another branch and store your commits or push them to remote repository for backup. Thanks!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • User mentioned (1): @Spencer's
  • Low reputation (0.5):
Posted by: heytulsiprasad