I detached gits head using git checkout 4037ec1702bd2fa6a5a15f7413f4ccccb59d356e . and lost all my work.

I still have the terminal open. Not that long ago, I did a git diff, so my changes were all echo'd to the terminal. I can only scroll so far up, however, and just can view the very end of the export.

Is there any way I can view what was earlier echo'd to the terminal? As stated, I still have the original session.

  • try, history | grep "echo" – msp9011 Jun 25 '18 at 13:48
  • 1
    That will just display the last time I typed in "echo". I am trying to actually see what was displayed on the screen, but the putty terminal doesn't allow me to scroll up that far. – user1032531 Jun 25 '18 at 13:49
  • Don't think you can do it, but you can increase the size of the scrollback buffer to prevent problems next time. – pLumo Jun 25 '18 at 14:06
  • gitand the system should have logging facilities enabled by default. Check in /var/log and the system journal with journalctl -b(assuming you're using a systemd-based OS). If you're lucky, the important output was logged. – Mioriin Jun 25 '18 at 14:06
  • @Mioriin Yes, I am using Centos7. What should I be looking for in the logs? Is the output to the screen actually logged? – user1032531 Jun 25 '18 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.